The secret behind the Flow Lookup component

Hey Everyone,

Happy Saturday!

The lookup component inside Screen Flows has tripped me and my colleagues up a few times.

And so today I wanted to share with you a short walk through on how to use them.

To start, from inside a screen flow, you can drag a lookup component to the screen element.

Next, we need to name the component and define our lookup relationship.

This is where the confusing part starts.

Let’s break it down:

Key Fields

API Name: Name you give the lookup component inside the screen flow itself

Field API Name: API name of field that already exists in Salesforce on a specific object and is a lookup to the object you want to show

Label: Name of the field as it appears inside the screen flow

Object API Name: API name of object that your lookup field from two steps ago exists on

Required: Indicates whether you want the Lookup field in your screen flow to be required

For example, let’s say I want to show account records in my screen flow:

By setting it up like we have above, users will be able able to choose Accounts from the lookup field when working in the screen flow (shown below):

What we did was specify the Contact object, and the field AccountId on the Contact object, because that field is a lookup to Accounts.

Why is this confusing?

Because the fields you need to reference for the component may have nothing to do with your flow logic.

We could achieve the same functionality by specifying any other account lookup in Salesforce.

Such as:

Object API Name: Case
Field API Name: AccountId

Object API Name: Opportunity
Field API Name: AccountId

Both of the configurations above would show account records in the lookup field when running the screen flow (just like our first example), even if your flow doesn’t reference Cases or Opportunities at all!

To be clear, the reason this works is because the Contact, Case, and Opportunity objects all have existing fields named AccountId

We’re simply telling the Screen Lookup Component:

“Hey, there’s a lookup relationship in Salesforce you can reference to show the records I’d like to show. This is the name of the object and field. Can you please show those records?”

To make it easy for you, I put together a cheat sheet of six common Salesforce objects and how to set them up in the Screen Lookup Component.

Feel free to save this for future use!

Enjoy your weekend.

Best,

Nick

Keep reading

See all posts →

Salesforce Saturdays

Join 1,036 Salesforce pros getting one 10-minute tip on Salesforce tech or career growth every Saturday.