Back to Help Index

Nested For Each Loop

When collecting Items from multiple Apps, all Items are placed in their own respective App bucket. This means when you loop through the collected items, there is no direct way to determine the Child Item (App B) for the current looped Parent Item (App A). This can be solved with a Nested For Each Loop and a Sanity Check.


Example

Collect all Projects from App A and the related Deliverables in App B and create a custom HTML table with data from both Items.

First, Get Referenced Items to collect all items from App A & App B.

Next, create a Custom Variable, prior to the For Each Loop, that will contain the start of the Custom HTML Table.

Start a For Each Loop for each of the collected items.
Add a Sanity Check to match the Deliverable to the current Project in the Loop.
Be sure to check that App A's relationship field matches the title of App B.

Continue building the table Variable, close the For Each Loops and Sanity Check, and then close the HTML table outside of the loop. This Variable token can now be used in a rich text box.

Here is the result of the table placed in a PDF:

Back to Help Index