How to use a Decision element

Lets go over one of my favorite elements!  The Decision!  This element really lets you make any Flow go to the next level.  By truly understanding and mastering the Decision element, you can really open up a world of possibilities!  I assume that most of you have had some experience writing formulas in both Salesforce and Excel.  The Decision element is simply a big IF statement for your Flow!  As of Spring 15, you can now even add in Advanced Logic to your Decision!!  This was a much needed improvement that will only make using the Decision element even easier to use.

Where is the Decision element?  You can find the Decision element under the LOGIC section of the Palette.

Finding Decision

Now we need to Name our Decision and determine the Editable Outcomes.  I think of this as adding a filter.  For each IF Statement (you can add more by using “Add Outcome”), what type of ‘record’ do we want to pass through this outcome?  Keep in mind that just like an IF statement, a ‘record’ stops at the first Outcome it finds as true.  So be careful that your filters are not too broad that some records accidentally turn true on other Outcomes.

It is important to note that you have many different options to choose from with your Resource and the Operator.  You are given the option, on choices, to use if a choice “was selected”.  For sObject variable fields, you can determine if a variable has been set to a value.  And for most elements, like a Fast Lookup or Loop, you can use wether the element was visited or not.

Adding an Editable Outcome

Salesforce finally added the ability to use Advanced logic in a Decision and hopefully you will find it useful.  If you have ever built a report or put a filter on a workflow, then you should feel right at home here.

Adding the Filter Criteria

The Default Outcome.  This is your ‘catch-all’ at the end of your Decision.  If any ‘record’ gets past all of the other Outcomes they will be sent to this Outcome.  You are required to create this outcome, but you don’t have to connect it to anything (more on that shortly)!

Default Outcome

Now we get to connect our Decision to some Record Create elements.  This is where we get to say what we want the ‘record’ to do if it meets our criteria.  In the below example, we are determining what I will eat for lunch based on how hungry I am.

Decision in Use

Now lets assume that I actually wanted to not eat lunch if I had breakfast.  We could simply just connect the “No” Outcome to the Record Create, but not send the “Yes” Outcome anywhere.  This means that when the Outcome is “Yes”, the ‘record’ will exit the Flow.

I am hungry

RECAP: Decision elements are your IF statements in a Flow.  IF you can think it – you can do it!  IF an Outcome is not connected to any elements, all ‘records’ that fall into that Outcome will exit the Flow.


2 thoughts on “How to use a Decision element

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s