2 loops/iterations inside Make.com

I have a very important issue. I want to create two iterations within Make.com that go through two columns of a Google Sheet.

In column A (A2, A3, etc.), I have industries (Machinery, IT SaaS, Automobile, etc.) from various sectors. In column B, I have departments (Sales, AfterSales, Marketing, etc.). The problem was that I couldn’t iterate over the columns directly because they were listed as separate elements, so I used a helper table that transposed the columns so I could iterate through them.

Now, the issue lies in the “Update a Cell” module. I want to dynamically specify the cell where the values should be written (at this stage, just the value “TEST,” which will later be replaced by the Perplexity API answer). Getting the row value is easy, but I am unable to dynamically generate the column letters B to P for the inner loop. It should write the values in B2, C2, …, P2. In the next iteration of the outer loop, it should write in B3, C3, etc.

I hope this is clear. Thank you in advance.

What does your scenario look like so far?

1 Like

Welcome to the Make community!

To allow others to assist you with your scenario, please provide the following:

1. Relevant Screenshots

Please share screenshots of your scenario, any error messages, 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 mapped variables in the module fields. At the bottom of the scenario editor, you can click on the three dots to find the Export Blueprint menu item.

3. Output Bundles of Modules

Please provide the output bundles of the 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. Upload as Text File

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

B. Insert as Formatted Code Block

If you are unable to upload files on this forum, alternatively you can paste the formatted bundles.
These are the two ways to format text so that it won’t be modified by the forum:

  • Method 1: Type code block manually

    Add three backticks ``` before and after the content/bundle, like this:

    ```
    content goes here
    ```

  • Method 2. Highlight and click the format 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!

Screenshot 2024-09-03 114559


blueprint (3).json (24.9 KB)

Now as you can see in the screenshot the main problem lies around getting the “B” to “P” as column value dynamically. The rest certainly is not efficient but works.

chronologically the output bundles are:

First iterator (outer loop):
[
{
“value”: "Accounting ",
IMTINDEX”: 1,
IMTLENGTH”: 1
}
]

Second iterator (inner loop):
[
{
“value”: “Sales”,
IMTINDEX”: 1,
IMTLENGTH”: 1
}
]

SET VARIABLE ITERATION START:
[
{
“iteration_start”: 1
}
]

SET VARIABLE ITERATION COUNT:

[
{
“iteration_count”: 2
}
]

SET VARIABLE COLUMN (Which I tried different things all didn’t work):

[
{
“Column”: “NaN2) - 1, 15))”
}
]