Mastering Iterator in Make.com: A Step-by-Step Guide (formerly Integromat)

Hideyuki Shibata
6 min readMay 3, 2024

--

Here’s the scenario template for this demo. It’s not free, but it will give you an idea on how to use the Iterator module.

You can also follow along with this post and build it on your own.

The Iterator module in Make is super useful, but it’s also one of the things where people get stuck. I know this because I’ve been there. But once I learned how to use it, it really opened up my new phase in automation. It lets you:

  • process data in bulk
  • keep your scenarios simple
  • deal with dynamic numbers of data sets

What I mean by “deal with a dynamic number of data sets” is that if the number is not dynamic, if it’s always 10 for example, you can keep copy-pasting a part of your scenario to make a repetitive chain to make it work. But with the Iterator module, you don’t have to do that.

From something like this:

Without Iterator: Prone to dynamic numbers of data sets and also hard to maintain

To this:

With Iterator: Can handle dynamic numbers of data sets and also easy to maintain

I guarantee you. Learning how to use the Iterator module will change your game. So let’s dive in.

Problem

Let’s start with a problem that Iterator can solve.

We have these questions we want AI to answer:

  1. Where is Portugal?
  2. What is the capital Portugal?
  3. How big is Portugal?

I’m starting my scenario with the JSON > Parse JSON module so I can create an array for this demo, but normally you have an array output from another module somewhere in your scenario.

Starting with the JSON > Parse JSON module for this demo

Its output looks like this:

This is what an array looks like in Make

And this is the array we’re talking about:

See the numbers? That’s the sign you are dealing with an array

Not-so-good way

Now, we want AI to answer all of these questions regardless the number of questions we have. Let me show you the not-so-good way first.

Not so good
Not so good

This is not-so-good because you can only select the first questions. It’s a bit confusing, so you are not to blame for not being able to understand this.

So what happens if you map this [1] thing for all the OpenAI module that follow it like this screenshot:

Let’s improve this

Well, you get three answers to the first question. So this is probably not the best way to work with an array.

Want no-code automation tips and secrets? I got you covered.

Subscribe to my newsletter. Don’t worry. I can’t code either.

Another not-so-good way (but the one that works)

Let’s add a little function to the current scenario. We can keep the structure intact (3 OpenAI modules).

The function you see here is get() and it works like this:

get(ARRAY; POSITION_OF_THE_ITEM_YOU_NEED)
get(ARRAY; 1)
get(ARRAY; 2)
get(ARRAY; 3)

Let me visualize what’s happening:

Do you ‘get’ it?

If we run the scenario, it sure works. And in some occasions, there’s no problem structuring your scenarios this way.

It works, until it doesn’t

So what’s the problem?

There are cases where you don’t know how many items an array has. For example,

  • If you are taking a user input as a trigger, you don’t know how many items a user is sending (how many array items a user is adding to the array)
  • If you are making an API call somewhere and the number of array items it returns is always different

These things do happen, like always. So it’s a good practice to always structure your scenario in a way that it can handle an unknown number of array items.

Good way

Let’s try throwing Iterator into the current scenario. It should look like this:

Scenario overview
Array as an input for Iterator
Map Iterator’s output (value) into OpenAI module

All we need to do is:

  1. pass an array to Iterator as an input
  2. pass the output (value) of the Iterator to the OpenAI module that follows it

That’s it! Always make sure to give Iterator and array and not anything else. Otherwise it won’t work.

As expected, the OpenAI module produced three outputs.

3 outputs (operations)

Often asked: How do I put them back together?

It’s easy to add new rows to Google Sheets or new records to Airtable with these outputs. You’d just add a corresponding module at the end of your scenario, in the case of our demo, after the OpenAI module.

But what I often get asked is this:

How do I put the outputs back together into a single string?

Yes yes, I know the struggle.

Well, as we can see, we have a (3) icon sitting on top of the OpenAI module, meaning it performed three operations.

The (3) icon means it performed three operations

Let’s add a few changes to the scenario.

Use Text aggregator

Simply put, Text aggregator takes a specified value from multiple outputs them stitch them together. Super convenient.

Make sure to choose Iterator for the Source Module field
Beautifully aggregated!

At this point, I see (in my head) some people saying:

Can we turn it into an array?

The answer is yes!

Use a delimiter and split()

I use this technique very often, but there might be an alternative. Let me know if anyone knows a better way.

So, when using a Text aggregator, you add a delimiter in the field. It can be anything but let’s go with this:

some text ||| some text ||| some text…
This ||| is ||| the delimiter |||

Let’s also add a Set variable module and use the replace() function like so:

replace(AGGREGATED_TEXT; , )

This splits the aggregated text delimited by ||| and organize the split texts into an array.

split(TEXT; ||| )

Let’s see if it works.

It worked 😉

In case you need to take a look at the whole scenario, here it is:

Flexible, simple, beautiful!

Over to you

Being able to use Iterator effectively opens up so many doors. The rest is up to you and your creativity!

Make sure to download the free scenario template I used in this post and play around with it. It’s not free, but it will give you an idea on how to use the Iterator module.

Feel free to connect with me ✌️ Happy automating!

--

--

Hideyuki Shibata
Hideyuki Shibata

Written by Hideyuki Shibata

Automation enthusiast. Come see my Bento: bento.me/hide

No responses yet