Branch the Flow

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. From the Elements tab in the toolbox, drag Decision onto the canvas.
  2. In the New Decision window, enter these values.
    Field Value
    Label Update or Create?
    API Name Update_or_Create
  3. In the Outcomes section, notice the two listed outcomes: New Outcome and Default Outcome. List of decision outcomes
  4. Make sure that New Outcome is selected, and enter these values into the Outcome Details section.
    Field Value
    Label Update Existing
    API Name Update_Existing
  5. For Condition Requirements to Execute Outcome, select All Conditions Are Met (AND).
  6. Click Add Condition and then enter these conditions.
    You can’t copy and paste the Resource values. For the first condition, type update_to into Resource, click on update_toggle >, then select Value. For the second condition, type Find into Resource, click on Contact from Find_a_Match >, then click in the blank space below.
    Resource Operator Value
    {!update_toggle.value} Equals {!$GlobalConstant.True}
    {!Find_a_Match} Is Null {!$GlobalConstant.False}
    Completed Outcome Details section
  7. In the list of outcomes in the sidebar, select Default Outcome.
  8. In the Outcome Details section, for Label, enter Create New. Notice that the list of outcomes now displays the outcome labels that you entered.
    Updated list of outcomes
  9. Click Done.
  10. Drag the connector node from Find a Match onto Update or Create?
    Canvas with four connected items
  11. Click Save.

Now you’ve equipped your flow with the logic to take one of two paths. Next, you build out those two paths.