When using repeat actions in your recipe, you will see an option to Clear step output. The default setting is 'No', which will typically work for most recipes. By setting the Clear step output to 'No', this means that all output in the datatree will be retained unless they are written over in the next iteration of the loop (in the next round of the indented repeat actions). This is the typical behaviour that people want in their recipes.
Let's take an example. In the below recipe, we trigger off upon new orders in Shopify to create corresponding invoices in Quickbooks and add lines to that newly created Quickbooks invoice. We do this by iterating through the Shopify order line items in Step 1 and its indented steps. In Steps 2 and 3, we will create the Quickbooks invoice if we're processing the first Shopify line item (when index = 0). In Steps 4 and 5, we will add a new line item to the created Quickbooks invoice if we're processing the second or any subsequent line items (when index > 0).
By setting the Clear step output to 'No', we retain the response in Step 3 for all iterations of the loop, even though we only execute the step once, which is when we process the first line of the line items. This ensures that we can refer to the ID of the invoice created when adding line items in the same foreach loop, which is very useful!
Alternatively, this means that if you select yes in the clear step output, you will not be able to use the QuickBooks Invoice ID as the second run of the loop will not have access to data from the first run, which will lead to an error!