Heavily Nested collections - Help with iterator and array aggregator

Hello! I am very new to make.com and attempting to build my first scenario. I’ve done a bunch of reading, asked chatGPT, and tried to work on this for the last 3 days and near my limit of 10k operations (yes I burned through so much :sad_but_relieved_face: ) I’m finally waving the white flag. Here’s what I want it to do:

  1. capture client ID from a Google Sheet (connection works just fine!)
  2. connect to an app’s API and GET client data based the client ID (able to connect and capture the data just fine!)
  3. The data is heavily nested, so I am using an Iterate module to help, ultimately need to capture timesheet entries - the start time (which captures the date, needed for the filter in step 4), and the duration (in seconds). (it…. works, maybe?)
  4. I have a filter to return the timesheets created for this month only. (filtering works fine)
  5. I have a set variable module to convert the seconds to minutes, and also round up to the nearest 15 minute increment. (I am able to create this, and it works)
  6. I’d like to aggregate (sum) up the rounded time values, do one more conversion to hours for easy reading (haven’t gotten this far)
  7. I’d like to email my client so they know how many hours of work has been completed

I think I am close, but there seems to be an issue with trying to aggregate this all together. Based on what I’ve read it may be due to the nesting of collections. here are some screenshots:

Scenario Overview:

HTTP Output: (I’m using the automatic parsing option in the module)

Iterate module: it appears to be ok?

Set Variable Function to normalize to minutes instead of seconds and round up 15 minutes. It breaks it out to multiple operations. 1 timesheet per operation

Array Aggregator settings and output. results are not what I’m expecting. Also when I attempted a sum up the rounded values, it maintained multiple operations, 1 timesheet per operation.

Open to advice and general guidance. I want to learn to get better at this. Thank you in advance!

Some of the related postings I read:

https://community.make.com/t/iterating-nested-collections/34068/13

https://community.make.com/t/how-to-obtain-data-from-heavily-nested-collections/33929/2

Hi @Alex_M

Welcome to the community.

Always set the Source module of the aggregator to be the module that produces 1 operation for each input bundle. In your case, it’s the iterator. That way, all operations become only one after the aggregator, with the output being an array.

This will help you move forward.

Please let me know if you need more assistance.

@damato

1 Like

Welcome to the Make Community!

Setting the Correct Aggregator Source

You need to set the “Source Module” field of the aggregator to where the bundles are coming from. This is usually an iterator module, but can also be a search/list/repeater module, or even the trigger module!

Combining Bundles Using Aggregators

Every result (item/record) from trigger/iterator/list/search/match modules will output a bundle. This can result in multiple bundles, which then trigger multiple operations in future modules (one operation per bundle). To “combine” multiple bundles into a single variable, 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. The next popular aggregator is the Text Aggregator which is very flexible and can apply to many use-cases like building of JSON, CSV, HTML.

You can find out more about the other types of aggregator modules here:

Question: Which is the best aggregator do you think you’ll need for your use-case?

Example

Here is an example of how your scenario could look like:

This is just an example. Your final solution may or may not look like this depending on your requirements and actual data.

For more information, see “Mapping with arrays” in the Help Centre. You should also do the Make Academy, which also covers the use of Iterators & Aggregators.

I hope this information assists you. Let me know if there are any further questions or issues.

@samliew

2 Likes

@samliew and @damato Thank you! Your info was helpful to learn how the source module actually work. I took that learning to figure out that I needed to use the numeric aggregator module.

No problem, glad I could help with "Heavily Nested collections - Help with iterator and array aggregator"! :slight_smile:

I’d recommend going through the Make Academy if you haven’t yet!

Here are some useful links and guides you can use to learn more on how to use the Make platform, apps, and app modules. I found these useful when I was learning Make, and hope they might benefit you too —

Learn Make

How-Tos


1. Which was the most helpful post in this thread?

The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep this forum organised. :folded_hands:

This marks the topic as solved, so that others can:

  • save time when browsing the latest activity on the forum, and
  • quickly jump to the solution in this topic

To do this, simply click the checkbox at the bottom of the post that is the most helpful in answering your question.

a screenshot of post menu options at the bottom of each post

:link: Here’s a magic link to a list of your other “unsolved” topics: status:unsolved

2. Have you learnt something new?

Do bookmark this topic so you can easily find and return to this topic in future.

a screenshot of bookmark link at the bottom of the topic

:link: Here’s a magic link to a list of your bookmarks /my/activity/bookmarks!

3. Have a different/follow-up question? Start a new topic.

Creating a new topic for each question makes it easier for others with the same problem to search for answers. You are also more likely to receive help sooner as new topics are displayed first on the forum’s “new” page!

I hope this information assists you. Let me know if there are any further questions or issues.

@samliew