Using Lookup Component on Screen Flow

Adding the Lookup Component

 

As you create your new screen flow, you will see on the top left-hand side the Components tab. You can select the component to add to your screen here. Search for Lookup, then drag and drop it on the screen canvas.

On the right-hand side, there’s a list of fields you will need to populate to make the component work.

 

Configuring the Lookup Component

 

Mandatory Fields:

API Name: Enter the Lookup component name.
Field API Name: Enter the API name of the field you want to access. Example: for accounts enter AccountID. Note: entering ID here won’t work because system won’t know where you what object you want the ID from.

Label: Enter the name of the field that you want to see. Example: Accounts or Companies.
Object API Name: Enter the Object API name that the above field resides. Example: you can find AccountID either on Contact or Opportunity Objects.

Tips: You don’t need to point to the source object that you’re working with.
Your goal is to duplicate an existing Salesforce relationship so that the flow can do the same lookup mechanisms behind the scenes.

Now that you have all the mandatory values populated to make this work, save the flow, and debug it to test if the lookup component is bringing you all the accounts to your screen flow.

 

Non-Mandatory Fields:

Record ID: Two ways to use this field.
One: You can add an ID Variable (AccountID) that you already have from another part of your flow to pre-populate the lookup field. This will not prevent the user from changing the pre-populated value.
Two: You can add an empty ID variable to store the value after the user selection to use it later in your flow.
Required: Where you make the field required or not. If the user must select an account to populate the field, then you select from the drop-down list the option {!$GlobalConstant.True}, otherwise leave it blank.

Other Quick Tips:

Opportunity: If you need to look up Opportunities, enter OpportunityID on Opportunity Line-Item object.

Contact: If you need to lookup Contacts, enter ContactID on CampaignMember object.
User: If you need to look up Users, you need a user relationship. enter CreatedByID for Field API name.

 

Conclusion:

The Lookup component gives you access to the existing lookup relationships in Salesforce, you should be able to get the right ID, even when you are using objects that have nothing to do with your flow, you should be able to lookup the records you need.
Hope this helps.

 

Carlos Oliveira
The Tether Team

#salesforce #salesforcecrm #tethertips #tether #fieldservice

Share the Post: