How to use a Fast Lookup

For this post we are going to show you where some of the real power in Flow can be found!  So, often times we get into situations where we want something to happen to multiple records.  In Flow we are given a Fast Lookup that will be one of our main tools to do this!  If you are from the developer background, think of this as a SOQL (or SQL).  If you’re from the Admin background and completely new to this, think of a Fast Lookup as a Report or List View.

Our business case for this example is that we want to find all Contacts associated to an Account with the Decision Maker field marked as TRUE.  When we find those Contacts, we will want to add them into a campaign

Where is the Fast Lookup element?  You can find the Fast Lookup element under the DATA section of the Palette.

Find Fast Lookup

Just like in the all of the other DATA Elements, we need to choose the Object that we are going to make an Update on.  Make sure you type the name instead of scrolling down!

Fast Lookup Object Selection

Now, we need to grab all of the Contacts on this Account that are decision makers.  We have a Custom Field called Decision Maker, and it is marked as TRUE when they are one.  We have also passed the Account.Id into our Flow’s variable var_AccountId.  So, using those two fields we can filter through all of the Contacts that meet our criteria.  Notice, instead of making a formula or setting a variable to make sure that Decision Maker is TRUE, we can use the {!$GlobalConstant.True} field.

Fast Lookup Object Filter Criteria

Great!  So, just like a Report or List View we’ve now grabbed all Contacts that meet that criteria.  And, just like a Report or List View we can sort through them in a specific order!  This can be handy in a Loop if you’re only wanting to apply your logic in the Flow to a limited number of Contacts.  Lets say, you only want to invite the three decision makers you’ve known the longest for each Account.  You could sort this query by CreatedDate and in your Loop only run the logic for three records.

Fast Lookup Sort Results

Alright, so now we get into the confusing part of a Fast Lookup because we are getting into these crazy SOBject Variable and SOBject Collection Variables.  Hard to grasp for most non-developers at first.  While we won’t exactly go through the differences in this post, I will say that 99.9% of the time you’re going to be using a SOBject Collection Variable in this situation.  They are what they sound like.  A collection of records that make up a variable.  Think of it like this.  When you Run your Report or view your List View, what does the output look like?  Its a collection of records, just like this!

Fast Lookup Variable Selection

When creating a SOBject Collection Variable, you need to make sure you select the correct Object Type.

Collection Variable

As I just mentioned,  when you run a Report or List View, it functions in just the same way as this!  Now, when I say that this time I am referring to your columns.  We can’t reference values inside our Flow if we dont assign them into our SOBject Collection Variable in our Fast Lookup.  In the below situation you can see that I am referencing the Email of the Contact, because that is needed for me to send out the email from within the Flow.

Fast Lookup Save Record Fields

Below, you have our completed Fast Lookup.  You can see that it has more going on than the simple Record Lookup, but considering the power that is inside this element, its actually really easy!

Fast Lookup Completed

RECAP:  Fast Lookup elements let you query for any number of records in Salesforce.    You can grab as many fields as you need to reference in your Loop by specifying them below your SObject Collection Variable.  Remember, a Fast Lookup is just like a Report or a List View.  You are potentially dealing with multiple records and you decide what to do with those records using a Loop!  If you’re ready to go into that, check out this post on a Loop!

4 thoughts on “How to use a Fast Lookup

Leave a comment