Decision Element

 

  • Decision Element

        • How to use Decisions

  • Decision Element



    When a flow executes a Decision element, it evaluates each decision outcome in order.

    For the first outcome whose conditions are met, the flow takes the associated path.

    If no outcome’s conditions are met, the flow takes the path for the default outcome.


    The decisions are configured as follows:

    1. We name the outcome(s) (1)
    2. We select the logic for the condition requirements (2)
    3. We add the condition (3)




    Conditions can also use an OR:


    Alternatively, conditions can use Custom Logic:




  • Exercise: Create a Decision


Build a Flow with a Decision


Adding Decisions to your Flow:

Create another new Screen Flow.

The flow you will build in this exercise will look like this:

It has a get records, a loop and two decision elements.



Add a Get Records element and configure it to get Contact records:



Add a Loop so you can now cycle through the contacts and make some decisions based on their content:



The first decision you need to add is to determine if the Phone number is missing. Configure as follows:

(note: Refer to the first picture to get the correct placement of this element)



Add a Screen with a Display Text message under the Yes branch:

(note: Refer to the first picture to get the correct placement of this element)




Add another decision to test for the email field.

(note: Refer to the first picture to get the correct placement of this element)




Add a screen with a display text message:

(note: Refer to the first picture to get the correct placement of this element)




Save, activate and run your new flow:

If you have contacts with missing phone numbers and email addresses, they will be displayed as follows:

If you don't see any results, edit some of your contacts and remove the phone number and email address.



No comments: