Skip to main content
Build the future with Agentforce at TDX in San Francisco or on Salesforce+ on March 5–6. Register now.
Time Estimate
Topics
Ask the Community

Branch the Flow

Note

Accessibility

This step requires some additional instructions for screen reader users. To access a detailed screen reader version of this step, click the link below:

Open Trailhead screen reader instructions.

Add a Decision Element to the Flow

Now that your flow checks for a matching contact record in your org, let’s branch the flow. The path the flow takes depends on whether a matching contact is found, and whether the user chooses to update the matching contact or create a new contact.

Add a Decision element to create two branches in the flow: one that creates a contact record, and one that updates any existing record that’s found.

  1. After the Find a Match element, click Add Element.
  2. Click Decision.
  3. In the New Decision window, enter these values.
    • Label: Update or Create?
    • API Name: Update_or_Create
  4. In the Outcomes section, notice the two listed outcomes: New Outcome and Default Outcome.
    List of decision outcomes
  5. Make sure that New Outcome is selected, and enter these values into the Outcome Details section.
    • Label: Update Existing
    • API Name: Update_Existing
  6. For Condition Requirements to Execute Outcome, select All Conditions Are Met (AND).
  7. Click Add Condition and then enter these conditions.
    • First condition:
      • Resource: select the Contact Info screen, then select the If this contact already exists, update the existing record component, then select Value
      • Operator: Equals
      • Value: select the True global constant
    • Second condition:
      • Resource: select Contact from Find a Match, then click in the blank space below
      • Operator: Is Null
      • Value: select the False global constant
        Completed Outcome Details section
  8. In the list of outcomes in the sidebar, select Default Outcome.
  9. In the Outcome Details section, for Label, enter Create New, then click in the blank space below. Notice that the list of outcomes now displays the outcome labels that you entered.
    Updated list of outcomes
    The current flow, with the Update or Create element added
  10. Click Save.

Now you’ve equipped your flow with two paths. Next, you build the elements that go on those two paths.

Share your Trailhead feedback over on Salesforce Help.

We'd love to hear about your experience with Trailhead - you can now access the new feedback form anytime from the Salesforce Help site.

Learn More Continue to Share Feedback