Assign Selections to a Text Variable
Create a Manual Loop with Assignments and a Decision
Next, create the Assignment element that stores the selections in one place as unstructured data, and the Decision element that kicks off the manual loop.
In this Assignment element, copy the selections into a text variable (varStringOfSelectedAccounts). The flow can’t copy these unstructured selections into a collection variable, because collection variables are structured. Instead, copy the selections into a text variable, because text variables can accept unstructured data and the flow can modify them later.
Every time the loop starts again, the Decision element checks whether varStringOfSelectedAccounts has any accounts. If varStringOfSelectedAccounts is blank, the Decision element takes a path that ends the loop.
- Create a text variable to contain the string of selected accounts.
- For Resource Type, select Variable.
- For API Name, enter
varStringOfSelectedAccounts. - For Data Type, select Text.
- Click Done.
- For Resource Type, select Variable.
- Create an Assignment element that copies the selected account IDs into a text variable.
- For Label, enter
Assign Selected Values to varString. - Make sure the API Name is
Assign_Selected_Values_to_varString. - In the first assignment row:
- For Variable, select varStringOfSelectedAccounts.
- For Operator, select Equals.
- For Value, select Select Accounts > Select accounts - all related contacts will be added to this campaign.
- For Variable, select varStringOfSelectedAccounts.
- Click Add Assignment and use these values in the second assignment row:
- For Variable, select varStringOfSelectedAccounts.
- For Operator, select Add.
- For Value, enter
;.
By default, the final selection doesn't have a semicolon at the end. However, the formulas that control the text look for semicolons after each selection. You add a semicolon to the end of the selection string so that your formulas operate correctly.
- For Variable, select varStringOfSelectedAccounts.
- For Label, enter
- After the Assign Selected Values to varString element, create a Decision element that determines whether the manual loop should continue looping (a Not Null path) or exit the loop (an Is Null path).
- For Label, enter
Check varString. - Make sure the API Name is
Check_varString. - In the Outcome Details:
- For Outcome Label, enter
Is Null. - Make sure the Outcome API Name is
Is_Null. - For Condition Requirements to Execute Outcome, select All Conditions Are Met (AND).
- For Resource, select varStringOfSelectedAccounts.
- For Operator, select Is Blank.
- For Value, select True.
- For Outcome Label, enter
- In the Outcome Order, select Default Outcome.
- For Label, enter
Not Null.
- For Label, enter
- For Label, enter
- Save the flow.