How to router based on a filter? If a filter is 1 do something if is 2 do something else and 3 something else

Hi, I need to apply in Quiclbooks credit memos to invoices. I need to apply only to the invoices where the Balance is greater than zero. I did a filter after the search invoice module. I need to router based on the filter.
There are 3 possible scenarios.
1.- FIlter is equal to 1. In this case, need to route to scenario 1 where 1 invoice will be applied to the Credit memo.
2.- In this scenario the application will be against 2 invoices, Need to get the values for item 1 from Bundle 1 from the filter and values for item 2 from bundle 2 from the filter.
3.- Same as scenario 2 but with 3 items.

You can use an array aggregator before the Router.

Every result (item/record) from a search module will output a bundle. To “combine” them into a single structure, you’ll need to use an aggregator of some sort.

Aggregators are modules that accumulate multiple bundles into one single bundle. An example of a commonly-used aggregator module is the Array aggregator module.

2 Likes

Thanks @samliew

Can you now guide me through the following Issue?

I have the Array from the array aggregator, I need to have on the 2 bundles scenario the mapping for the 2 invoices found plus the credit memo. On Item 1 from Quickbooks create payment module I need to map the information from position 1 of the array, and on Item 2 the information from position 2 of the array.

I tried to use the get function and it seems it works to map the Amount field but when I Try to get the Transaction ID since this is on a nested array inside the main one I can not get the correct path.
Screenshot 2023-09-29 at 11.29.02 a.m.

Hi its a case senstive please use the exact key , 1.Amount is fine beacuse it doesnot have the extra word or character
1.Linked_Transaction this should be exact name thats incoming as you are using Underscore , which I think causing a error , try without that and copy the exact spelling

2 Likes

Thanks, @CodexSolutions I found that the “get” function requires the “RawName” and not the generic name of the variable.
I was able to run the process successfully now.

Thank you!

1 Like