01 Getting Started

This tutorial covers loops in action flows. The loop provides a way to loop over three main elements:
  • Power Table
  • Repeated Strip
  • Variable
Conditions can provide the same capabilities as loops for repeated strips and power tables.
Loops should only be used if there is no other solution available. Loops should not be run over many elements within a table or a repeated strip as it will slow down your project.
Power tables with buttons have been used for demonstrative purposes.

02 Insert a Loop Toast

1. Click on the Button link icon. The On Click Action screen opens.
button menu > on click action
2. Click the Start + icon. The Add Node screen opens.
on click action screen
3. Select Loop and click Next.
loop node
4. Use the drop-down to the element you want the loop to apply to. For example, the account table. Click Next.
loop on element
5. Add a tag and click Insert.
The node is added to the screen.
6. Click on the Each + icon to run an action on each row in the table. The Add Node screen opens.
plus icon for each
7. Select Show Toast and click Next.
show toast nodes
8. Configure your toast message. For example, the element drop-down was used to display the account name in the toast. Click Next.
configuring toast
9. Add a tag and click Insert.
The node is added to the window.
10. Click Apply.
on click action configuration
Save and preview. When the button is clicked, a toast showing the first account name is displayed.single toast example

03 Continue the Loop

You can configure the toast to run all the account names.
1. Navigate to the On Click Action screen. Click the Toast + icon. The Add Node Screen opens.
2. Select Continue and click Next.
continue node
3. Type in a Tag and click Insert.
The node is added to the screen.
4. Click Apply.
on click action screen
Save and Preview the project. When you click on the button, multiple toast messages are displayed of all the Account Names in the table.
looped toast

04 Add a Condition to a Loop

1. Navigate to the On Click Action window. To insert a condition in between For Each and Show Toast, click the X icon.
remove link
2. Click the For Each + icon. The Add Node screen opens.
3. Select Condition and click Next.
condition option
4. Configure the condition. For example, the account number is not empty. Click Next.
condition config
5. Add a Tag and click Insert.
6. Click the Then + icon. The Add Node Screen opens.
7. Select Table Interactivity and click Next.
Table interactivity node
8. Use the drop-downs to configure the action and table element. For example, select a row for the account table.
table interactivity configuration
9. Add a Tag and Click Insert.
The node is added.
10. Use your cursor to connect Table Interactivity to Continue. For this example, the nodes were connected in the following configuration.
The Toast message was updated to display ‘Loop Done’.
11. Click Apply.
connected nodes
Save and Preview. When you click the button the loop runs. The Toast displays when the loop is complete.loop done

05 Insert a Break

You can add a break to stop the loop when it gets to a specific point. For this example, a break will be inserted after a specific Account Number.
1. Navigate to the On Click Action screen.
2. Double-click on the Condition icon. The Edit Node screen opens.
3. Configure your conditions to stop after a specific Account Number.
configure conditions
4. Click Next, and on the next screen click Save.
5. Click the Equals Then + icon. The Add Node screen opens.
equals condition plus sign
6. Select break and click Next.
break node
7. Add a tag and click Insert.
The node is added.
8. Click Apply.
on click action config
Save and Preview. When you click the button the loop will only run until the specified account number.
preview of break config

06 Loop for a Repeat Strip

This example is a configured repeat strip that includes a text field that pulls Account data from Salesforce.
A secondary button was inserted into the previous strip
1. Click the link icon of the secondary button. The On Click Action screen opens.
secondary button menu
2. Click the Start + icon, The Add Node screen opens.
3. Select Loop and click Next.
4. Use the drop-down to select the element. For example, the repeat strip. Click Next.
add node > loop
5. Add a tag and click Insert.
6. Click the For Each + icon. The Add Node screen opens.
7. Select Show Toast and click Next.
show toast node
8. Configure the toast message and Click next.
9. Add a tag and click Insert.
10. Click the Show Toast + icon. The Add Node screen opens.
11. Select Continue and click Next.
continue node
12. Add a Tag and click Insert.
 The node is added to the actions flow.
13. Click Apply.
on click action config
Save and preview. when the secondary button is clicked, the toasts are displayed.
displayed toasts

07 Loop for Variables

Two tables were created for this demonstration. On the left table, users can select opportunities, and the right table displays price book entries.
table examples
1. Click on the Pages drop-down and open the kebab sub-menu for the page you want to configure.
2. Click the Configure Actions button. The Configure Actions screen opens.
pages drop down
3. Click on the Static Variables tab and create a new variable. For this example, the variable is to indicate the Opportunity ID from Loop.
static variable
4. Click on the String Formula Field Tab and create a new string variable. For example, opptable_selection. Select the Configure button. The Configure String Varibale screen opens.
added string
5. Configure the string variable. For example, the opportunity table selection. Click Apply.
configure string variable
The following action flow was configured for the button. The Salesforce Action was limited to 20 entries as this is the maximum number of pushes to Salesforce that Titan can complete at a single time.
on click action screen
Configuration for the loop was set up as follows:
Note: When the loop is set up over a variable you can set up a static value or dynamic field split delimiter.
loop on element config
Configuration for the affected variable was set up as follows: The loop variable will display the loop value.
edit node > affected elements
The Salesforce Action was configured as a push.
salesforce push
Save and Preview the project. Make selections from each table and click on the button.
product selections
The loop will run over the selected products and run a Salesforce Push.
Navigate to the Integration Logs. A total of five opportunity products were created to match the five selections made.
salesforce integration logs

08 Got Feedback?

Additional Resources