Branch the Flow | 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.
- Underneath the Elements heading, activate the Add Element button located between Find a Match and End
- Select Decision from the menu.
- In the New Decision window, enter these values.
Field |
Value |
Label |
Update or Create? |
API Name |
Update_or_Create |
- Under the Outcomes heading, there is an Items list containing two outcome tabs: New Outcome and Default Outcome. This list poses some challenges for screen readers. We’ll walk through navigating this list a bit later on.
- The New Outcome tab is selected by default. Enter these values into the Outcome Details section.
Field |
Value |
Label |
Update Existing |
API Name |
Update_Existing |
- For Condition Requirements to Execute Outcome, select All Conditions Are Met (AND).
- Click the Add Condition button.
- For the first condition, type update_to into the Resource edit field. Take note of how update_to is spelled. Press DOWN ARROW to expand a list with Screen Component update_toggle listed as the only option. Press ENTER to select it.
- A second list will immediately appear. Select Boolean value from the list.
The first resource field should now contain {!update_toggle.value}. You can’t paste values into these fields, so it’s necessary to go through these steps. We’ll fill out the operator and value fields in a moment.
- For the second condition, type Find into the second Resource edit field. Press DOWN ARROW to expand a list of results and choose Contact from Find a Match.
- A list of fields will appear immediately after you press ENTER. Simply press TAB to exit the list. The resource will be added.
- Verify the two resource fields show the correct data. The first resource field should show update_toggle > value, and the second should display Contact from Find_a_Match. If your resources aren’t correct, use the associated remove buttons on the page and reenter the data.
- Each resource has an associated operator and value field. Complete those fields with the data below:
Resource |
Operator |
Value |
{!update_toggle.value} |
Equals |
{!$GlobalConstant.True} |
{!Find_a_Match.} |
Is Null |
{!$GlobalConstant.False} |
- Under the outcomes heading, select the Default Outcome tab from the Items list. This list may be tricky at first for screen readers, so refer to the sections below for steps for your specific screen reader.
JAWS Users
- Place focus on the list and turn JAWS virtual cursor off to begin accessing the list.
- Press down arrow. The second tab in the list, Default Outcome is now focused.
- Press ENTER to select Default Outcome from the Items list, then TAB into the Label field to ensure the correct tab has been selected.
NVDA Users
- Place focus on the Items list and manually enter focus mode.
- Press down arrow to find and select the Default Outcome tab and press ENTER to select it.
- TAB into the Label field to verify the correct tab has been selected.
- In the Outcome Details section, for Label, enter Create New. The Items list now displays the outcome labels you entered.
- Click the Done button.
- The flow canvas should now show the Update or Create? decision element followed by the two outcomes and the End element node.
- Activate the Save button.
Now you’ve equipped your flow with two paths. Next, you build the elements that go on those two paths.
Click to return to the unit on Trailhead to verify this step.