I just want to send one email with all the 'bundles'

:bullseye: What is your goal?

I want at the end of this scenario to send one email with all of the information thats in the array aggregator.

:thinking: What is the problem & what have you tried?

i am getting 17 emails. i have tried many things, and asked chatgpt, but i havent found a solution yet. i am not well versed in make.com

:clipboard: Error messages or input/output bundles

no errors

:camera_with_flash: Screenshots (scenario flow, module settings, errors)

Hi @Ian_Kerry

Set the Source Module of the Aggregator to be the Iterator that produces a single email. In this case, it’s probably Performances.

@damato

1 Like

Thanks damato. That didn’t work, sadly. Also I need info from both the arrays (5&&), but even so it was sending me even more than the 17 that normally gets through the filter.

1 Like

Your scenario can probably be simplified, removing the 2nd Iterator (use get() and map()to retrieve the values from the performances array) and the Set Variable, and using a Text Aggregator instead of Array Aggregator. Can you share the outputs of the iterators?

1 Like

Hi Damato,

The output of 5.events is 257 bundles (this carrys the name of the film). The 7.performances outputs 257 operations, in just one bundle (this iterator gives me the venue name and date).

I could try and delete the ones as you suggest, but this would take me some time so i am loathe to do it if there is a simpler solution? but i will if needs be.

thanks again

Ian

1 Like

From your 1st screenshot, it looks like 5.Events outputs 1 bundle and whatever array 7.Performances iterates on contains 257 items. Then your COMING WEEK filter narrows it down to 17 results, setting 17 variables.

To correct the scenario, you must determine how many emails you want to send:

  • One per venue name and date (it’s working like this right now and probably not what you want)
  • One per name of the film (Event) → Aggregate with 7 as the Source Module.
  • One for each scenario run → Aggregate with 5 as the Source Module.

Without seeing the data structures from your API request, I can’t say much more. Are you using TMDB?

Hi Damato,

I am using an API from a system we use to manage all our bookings and it feeds the website.

I want one email with all 17 events that are going to occur in the next 7 days.

The 5. events has an output of 257 bundles. so 1 output of 257 bundles.

and yes for some reason the 7performance outputs 257 OPERATIONS each of which is 1 bundle… maybe there in lies the issue… i will go and take a look

Ian

You always set the source of aggregation to the module producing extra bundles. In your case the set variable module is processing 17 existing bundles and not producing any new ones. And it looks like its the same with performances, processing 257 existing bundles and not producing any new ones.

Check whichever module has more output bundles than input ones.

1 Like

Ok, so that’s the module you must aggregate on 5..

Thanks damato, and stoyan_vatov. I appreciate you trying to help, I am clearly out of my depth, as I dont really understand the answers.

So I will go and have a period of reflection…

Best wishes,

Ian

1 Like

Ok so each module has an input and an output. An iterator module processes arrays, so there is one input bundle - the array it self; but it outputs a separate bundle per item inside that array. For the most part Search and List modules work the same way.

The easiest way to identify them is to check the number in the bubble next to the module. 1 means the module ran only once (there was only 1 input bundle). But the next module ran 257 times (there were 257 input bundles). So the first module must have produced the extra bundles.

The aggregator modules work in the reverse way - they have multiple input bundles but only one output bundle (unless you configure them to have more). They combine separate items back in an array. But in order for them to work, you need to set the correct source module.

A major mistake that keeps reappearing here in the community is that people set the source of the aggregation to the module they want to get the data from. But this is usually not the correct module, as that is a module that only processes existing bundles (as is your case). You always want the source of aggregation to be either an iterator module, a search module or a list module, aka a module with more output bundles than input bundles.

And judging by your screenshots it looks like this is, like damato pointed out, module 5.

1 Like

Thanks again, Stoyan.

You might lose patience with me, because my knowledge of make.com is quite limited. But that is fine if you do! Maybe by trying to explain the issue, I might learn something or even have a eureka moment.

My http gets 1 bundle of 257 bits of data (collections?) from the api.

you will notice that under each collection there is a folder called performance, and this is how many times that film is being (or has been) screened.

the next module the iterator looks at the top folder (data)

This outputs 257 records each one in a bundle of its own.

The next iterator looks at that performance folder mentioned earlier. it points to the previous iterator at that folder.

This outputs 257 operations - not bundles - and i am not sure why.

i then have a filter that only gives me dates of events in the next next 7 days and it is this data that i want all in one email. currently there are 14 emails.

In gmail, it doesnt matter which iterator i point to, it always sends more than 1 email.

So I am missing a key bit of info - where am i going wrong?

Actually despite what i have written i am losing the plot. i was hoping there would be a more straightfoward answer. So don’t worry i have lost patience with myself.

am heading off for the day.

thanks again

That’s ok. If you have some spare time you can check out academy.make.com, its a great source of knowledge.

Anyways - the bubble next to the second iterator shows that it ran 257 times, not how many bundles it produced. But since you have a filter afterwards, only 17 of those bundles passed it. This the set set variables module ran only 17 times.

Most likely, the second iterator produces way more bundles, but the filter stopped them.

So by setting the first iterator (5) as the source module of the aggregation, you will go back to 1 bundle and the Gmail module will run only once.

Now since you are sending an email with this info, I assume you want a text block in the email body? You may need to use the join() function inside the gmail module and map the array from the aggregator module inside so you can send it as a text string.

2 Likes

This is what the iterator at 5 does. It receives an array (Data[]) with 257 items (Collections). Then, for each item, it executes all the modules after it once. When you iterate again on 7, your Iterator again generates one execution of the following scenario modules once for each item in each performances array. Sum the total items of those 257 performances arrays and you’ll get the number of emails sent :sweat_smile:.

As Stoyan pointed out, you filtered most of these results, so you got 17 emails. That’s not very efficient in terms of credits as well.

You could probably achieve your goal witha scenario similar to this:

Just iterate the Data[], filter the results inside performance and aggregate them in a text value. Then use that text in your email.

Can you click on a Collection inside the performances array to show its structure?

1 Like

Thanks. I did as you suggested, and started a new scenario, in the way you suggested, and i now have one email with all the events coming in the next 7 days.

I want to thank all of you who answered my query. I think you all helped to get me over the line!

Now for the next challenge.

Best wishes

Ian

2 Likes

That’s great news! Congratulations!
I’m glad I could help.

1 Like