Skip to main content
Scheduled Maintenance: Trailhead, myTrailhead, and Trailblazer Community will be offline January 17, 16:00–20:00 UTC. Thanks for bearing with us as we update your experience!

Durée estimée

Thèmes

Demander à la communauté

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.

  1. 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.
  2. 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.
    • 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.
  3. 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.
    • In the Outcome Order, select Default Outcome.
      • For Label, enter Not Null.
  4. Save the flow.
Partagez vos commentaires sur Trailhead dans l'aide Salesforce.

Nous aimerions connaître votre expérience avec Trailhead. Vous pouvez désormais accéder au nouveau formulaire de commentaires à tout moment depuis le site d'aide Salesforce.

En savoir plus Continuer à partager vos commentaires