How to create a loop within a loop?

How to create a loop within a loop? Or what construction to use for the following task:
There are 10 roles. I want to create a comment under each role and also check editing the created comment under each role.

Requests in different loops are not sent sequentially. Is it better for me to make a list of the IDs of the created comments and then use another loop to go through this list for each role?

Hi @vpolshchan

Welcome to the forums!

The easiest way to achieve what you’re trying to do is to save all the info from the first loop as a record with all the info from the loop combined into a new list that’s collected then iterate through all those items again to allow synchronization.

So in your case, combine the current output (item) of your first for block with the comment output as a record, then collect it, from there you can start a new for loop that starts your second loop with all the necessary info.

Something like this (simplified example):

And our engineering team is aware of and fixing the display bug with the list/record primitive overflow. :slight_smile:

Thank you for the answer. I have another question.
I’ll end up with two lists:

  1. A list of created comment IDs
  2. A list of each role’s email for authorization and subsequent editing of each comment

How do I work in one loop with two lists, or with a list like in your example that contains both email and comment ID?

You should only have one list.

The item returned by each loop iteration will be an object with two properties which you can use by selecting the name of the field (in my example, item or result).