Loop through table

The Loop through Table action is used to apply actions for a set number of records from a table.

For example: You have a table with names. You want to go through all the records in the table and update each name to ensure it has a Title case, i.e. is capitalized.

  • Select a table: the table to loop through
  • Where: the criteria builder will allow you to define a set of records of the table to loop through
  • Only distinct values from: you can ensure only records with unique values in a given field will be looped through
  • Order by: when looping through the table, you can set the order the loop is going through

Criteria Builder

When you select Open criteria builder, a new page opens listing all the conditions.

Conditions are used to specify which records you want to loop through.

How do conditions work? When Method loops through the table, it will look at every record in the table, but only include records that match the given conditions. 

  • If All/Any of the following are true:
    All - Every condition must be true in order to delete
    Any - At least ONE of the conditions is true in order to delete
  • Field: the first dropdown is the field to check in the table
  • Comparison: the second dropdown is the comparison operation to perform between the field and the given value
  • Value: the next two fields specify the value to compare the field to
  • Add another condition: create additional conditions
  • Add another group: you can separate conditions into groups. This is similar to how parentheses work in mathematical equations - conditions in groups are calculated together.

For more information, please visit our article on The Criteria Builder.

Embedding actions

Actions are embedded within the Loop Through Table action. When you hover over the action, the plus sign will add an action indented underneath the Loop Through Table action.

You can also drag and drop other actions within the Loop Through Table action.

These actions will be applied to every record being looped through. 

Example

In this example, the action is set up to go through all the records in a table with a text field called Name.

Within the loop of the action are two other actions, Character Functions and Update Fields in Table. Note the line which groups them together. 

Within Character Functions action, you need a way to grab the value of the Name field from the loop. Under the drop down Convert this to title case, there is a section called Loop. Underneath you will find all the field values of the current record within the loop.  The result of the Title Case function will store the result in an action result to be eventually used by...

The Update Fields in Table function will take the action result and update the Name field in the table. Which record will it choose? Within the Criteria Builder, again, you can use the Record ID under the Loop section, which is the Record ID of the current record within the loop.

Was this article helpful?

Can’t find what you’re looking for?

Contact Us