Confusion with Iterator

Hello all,

I am still a novice in the Make world but have been working with scenarios.

But the latest one is challenging me.

The scenario:

I collect recipes and I want them to be sorted out into different categories (Indian, European, Asian etc.)

The recipe links land in my mailbox with the subject as “recipes Indian”, “recipes European” etc.)

I want them to be automatically forwarded to a Google Sheet where I have created sub-sheets for the respective categories.

This is my flow:

The Gmail module collects all the emails with the subject:recipes.

From there, I collect them using an Aggregator.

Then, a router is connected.

From the router, there are different iterators, each for a category. Each of these iterators then are connected to the appropriate Google Sheet sub sheet.

I tried various other flows but this seems to be working.

Except for one issue: for example, if I receive three emails for Indian, European and Italian recipes, they all land in the respective sheets but the content is from the ‘recipes indian’ email. The iterator input and output for Italian show “recipes indian”.

I am attaching the screenshots for the modules.

Any help will be greatly appreciated.

Many thanks.

Recipes_ModuleIteratorItalianOutput
Recipes_ModuleIteratorItalian




Hi @Senthil_Ratnasabapat

In the iterator, use an aggregated array and apply a filter for each subject.


If you require additional assistance, please don’t hesitate to reach out to us.
MSquare Support | Book Live Implementation
Visit us here
Youtube Channel

2 Likes

Have you tried adding a filter before each iterator to ensure only the relevant category data is passed to each iterator? For example, you could set a filter to check if the subject contains “Indian”, “European”, “Asian”, etc.

2 Likes

The array aggregator has a group by field.

Couldn’t you just group by the type (category)?

This way you might not even need a router.

2 Likes

Thank you so much.

It worked. I had to do it as a fresh scenario and had to create all the modules and even then sometimes there was an issue with the filter and/or iterator. I think for some reason it was tethering itself to certain emails.
But in the end it worked.

Thanks again.

2 Likes

That’s how I had initially set up the scenario but didn’t work. MSquare had suggested putting the filter after the iterator and changing some of the commands and it worked.

Thanks a lot.

2 Likes

I had used the aggregator to collect all the emails and then the separate them through the iterator. WAsn’t sure how to use the aggregator to separate the emails according to the category.

Thanks

2 Likes