Is there tool to combine two array aggregators after a router steps?

I am trying to create Xero Invoice with the data from Google Sheet.
However, there are requirement on the account code to be putting into Xero’s invoice line item which the example is as follow:

There are 3 lines in Google sheet with the respective Data
Header Row: Date | Description | Amount
Row 1 Data: 04/05/2024 | V-Power 97 | 1000
Row 2 Data: 04/05/2024 | Unleaded 95 Bulk | 1200
Row 3 Data: 04/05/2024 | Unleaded 95 Bulk | 1900

Requirement:

  1. All of these data should be in within the same invoice number in Xero
  2. Able to create line item in Xero within the same invoice
  3. Able to identify description and map with the right account code in Xero

What i have created the flow and modules as screenshot attached. Besides that, I have created router to determine the flow base on description, and by the end of the modules i need to combine both array aggregators into one so that all the data can be in within the same Invoice in Xero as line item, with different account code.

Hello

You really don’t need router #24 if you’re following it with separate iterator-aggregator pairs. You can just put those iterator-aggregator pairs inline with each other and the rest of the scenario. If you need to combine them you can try the merge() function.

3 Likes

Hi Donald,
I am a bit lost here.
When i am trying to sync all data from Google sheet to Xero for one single invoice, it works very well with solely Array aggregator 19 > Search Xero Contact > Create Xero Invoice.

However, when I am trying to determine the account code base on description, i lost my track on how to do it. The reason of Router 24 is to differentiate the description of “V-Power 97” & “Unleaded 95 Bulk” so that I can have account code configurable respectively as this screenshot


For separate iterator-aggregator pairs and merge it later, indeed i have tried this for my other scenario and it works perfectly fine. It is just that this is not working for my current one as the different account code gotta be match with different description issue.

Any suggestion or modules that can achieve this?

In the Account code field, you could use an if() or a switch() function on the description.

It’d look something like this:

if(description=V-Power 97 BULK;6203/S01;the other account code)

switch(description;V-Power 97 BULK;6203/S01;FuelSave Unleaded 95 BULK;other account code;account code if description didn't match either)

3 Likes

Hi Donald,
With your suggestion of switch function, the workflow working perfectly fine now.
However, another issue occur.

Date, Due Date & Reference fields in the last module of “Create Xero Invoice” are not able to get data from Google sheet “Search Rows 39”. I have tried to include Search Row module between Search for contact 42 and Create an Invoice 43, it manage to allow me getting data fields of Date, Due Date & Reference but the result is 5 same invoice created in Xero.
As screenshot below.

Any suggestion?