Struggling with iterators and aggregators

Hi,

I’m working on a scenario to create invoices in Invoice Ninja from Airtable records. The goal is to generate separate multi-row invoices for each client based on their respective orders in Airtable.

Current Setup:

  1. Airtable: Search Records (Clients): Fetches all client records.
  2. Iterator (for Each Client): Iterates through each client record.
  3. Airtable: Search Records (Orders): Fetches all order records for the current client using a filter (Client ID from the iterator).
  4. Array Aggregator (for Orders): Aggregates orders for the current client.
  5. Invoice Ninja: Create an Invoice: Creates an invoice using the aggregated order array.

The second “Search Records” module correctly outputs 8 records (orders for three different clients). However, the Array Aggregator combines all 8 records into a single array, resulting in multiple identical invoices addressed to one client.

How can I adjust my scenario so that it iterates through the orders for each client individually, ensuring each invoice includes only the respective client’s orders?

Any help on this would be much appreciated!

The issue is that you are probably using the Iterator incorrectly, because the output from the first search module already returns bundles, and not an array.

Every result (item/record) from a search module will output a bundle. So you do not need an Iterator module.

If you need further assistance, please provide the following:

1. Screenshots of module fields and filters

Please share screenshots of relevant module fields and filters in question? It would really help other community members to see what you’re looking at.

You can upload images here using the Upload icon in the text editor:

2. Scenario blueprint

Please export the scenario blueprint file to allow others to view the mappings and settings. At the bottom of the scenario editor, you can click on the three dots to find the Export Blueprint menu item.


(Note: Exporting your scenario will not include private information or keys to your connections)

Uploading it here will look like this:

blueprint.json (12.3 KB)

3. And most importantly, Input/Output bundles

Please provide the input and output bundles of the trigger/iterator/aggregator modules by running the scenario (or get from the scenario History tab), then click the white speech bubble on the top-right of each module and select “Download input/output bundles”.

A.

Save each bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.

Uploading them here will look like this:

module-1-output-bundle.txt (12.3 KB)

B.

If you are unable to upload files on this forum, alternatively you can paste the formatted bundles in this manner:

  • Either add three backticks ``` before and after the code, like this:

    ```
    input/output bundle content goes here
    ```

  • Or use the format code button in the editor:

Providing the input/output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

Following these steps will allow others to assist you here. Thanks!
samliewrequest private consultation

Join the Make Fans Discord server to chat with other makers!

Hi @Zeppelix
First, select the correct source module. Then, choose “Show advanced settings” and provide the group by “client” there.


Sample output:

Regards,
Msquare Automation - Gold Partner of Make

Free Consultation | Live Implementation

Visit us here | Youtube Channel

A sincere thank you to both of you for helping out! :slightly_smiling_face:

For anyone who might be struggling with an issue similar to mine, this is what my finished and functioning scenario looks like:

Added a filter to make sure that only bundles related to the currently iterated Client ID are passed through:

Added a router and a filter after the array aggregator to make sure that Client ID’s with no Orders are not passed to Invoice Ninja:

3 Likes