Google sheet populate multiple rows in a repeat loop

Hi all, I’m stuck on a scenario where I want to populate multiple cells in multiple rows.

In the scenario I am only using:

  • Flow control
  • Google sheets
  • ChatGPT

Essentially I have one pre-populated column (A), and then based on different prompts I will populate each cell with ChatGPT answers. Then once row 2 is done (there is a header row), I want it to go to row 3, loop through and do the same again, then the next row (4), and so on.

I was able to run the repeat, but made an error somewhere whereby only the first row kept getting replaced. Versus it populating the corresponding rows.

I’ve attached five screenshots. I believe it is in the iterator, then Google Sheets Update Cell, where my error is. But after spending hours yesterday troubleshooting and resorting to trail and error via deduction I am stumped.

Can anyone point me in the right direction with a solution?






a

Welcome to the Make community!

1.

It doesn’t make sense for you to immediately follow a Search module with an Iterator, because each result will already be a bundle, and there is no array for you to split into separate bundles.

2.

I don’t know why you are starting the scenario with a repeater, but the i variable from this goes from 2 to 3 to 4.

3.

You didn’t show how your sheet looks like, so this screenshot is quite useless without that context.

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”.
Screenshot_2023-10-06_141025

A.

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

Uploading them here will look like this:

module-1-input-bundle.txt (12.3 KB)
module-1-output-bundle.txt (12.3 KB)

B.

If you are unable to upload files on this forum, alternatively you can paste the formatted bundles in this manner:

  • Either add three backticks ``` before and after the code, like this:

    ```
    input/output bundle content goes here
    ```

  • Or use the format code button in the editor:
    Screenshot_2023-10-02_191027

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.

4.

For Iterator modules, the input only accepts a single ARRAY variable.

This is NOT an array.

You are likely missing a step here, but IDK what to make of this because you didn’t share ALL the information about what you are trying to do and how your spreadsheet looks like.

Please provide a public read-only share link to your spreadsheet so that we can create/recreate an example scenario on our end.

2 Likes

Hi @samliew, thanks for coming back to me.

Here’s the view only spreadsheet: EAP Prospecting - Google Sheets

I tried responding earlier @samliew but it got caught in spam as I added the link you asked for, can you get it released so we can keep going?

Re what I am trying to do, I’ll work to clarify:

  1. The job to be done is for a spreadsheet to get completed cells and rows based on answers from ChatGPT
  2. There are 6 rows to be completed, B-G. Each one is completed individually by a prompt to ChatGPT.
  3. This process is triggered by the pre-populated information in row A.
  4. A row is defined as complete once the cell in row G has been populated by ChatGPT.
  5. Once one row is complete, I want the loop to repeat going to straight to the next row.
  6. Over time I have 62 rows to complete.

I’m not sure what you meant by this. Perhaps a forum moderator needs to take a look, or you can try posting again.

Hello @BenjaminSa the link is now available :arrow_down:

1 Like

Thanks @Michaela.

@samliew does that help any further? Thanks for your help here.