Getting Started with Salesforce Flow – Part 12 (What? Use Lookup Field into a Flow Screen Element?!!)

Getting Started with Salesforce Flow – Part 12 (What? Use Lookup Field into a Flow Screen Element?!!)

Last Updated on December 19, 2020 by Rakesh Gupta

Salesforce Flow allows us to automate business processes by building applications, known as FlowsUsing Flows, a user can collect information; or, they can update, edit, or create records in Salesforce. Furthermore, Flows can execute logic, interact with the Salesforce database, call Apex classes, Platform Events, and guide users through various screens to streamline the process of collecting and updating dataOnce a Flow is built, an Admin can make the Flow available to the right users or systems.

Salesforce Flow is similar to the Visualforce page for admin – for, by using Salesforce Flow, an Admin one can create a powerful wizard for data entry or display a message without writing a single line of code!

There may be times when an Admin wishes that s/he could add a Lookup field to Flow Screen Element. Now Salesforce Flow does support the Lookup field. Otherwise, an Admin needs to use a Lookup field, s/he has to use Dynamic Record Choice

For example, suppose you want to use lookup functionality to display Chatter Group – based on matching results – to users based on their input. If so then, you can do so using the following Elements:

  • Two Screen elements
  • One Textbox field
  • One Dropdown List field
  • One Variable 
  • Dynamic Record Choice

Check out this video for detailed instructions:

 

Screenshot for your reference (transcript of the video):


Ya, I know! Looks, and is, pretty complex to build a Lookup kind of field in Salesforce Flow. 

You may be wondering – can I achieve the aforementioned solution using just one field with a better outcome?

Well, you are in luck! Let’s see how 

Business Use Case

Edward Backhouse is working as a System administrator at GurukulOnCloudHe received a requirement to add a Lookup field on the Flow Screen element which should instantaneously display Account based on user input. 

The solution for the above business requirement

There are a few possible solutions for the above business scenario. One of them, of course, is to continue to use the old method, as shown in the preceding screenshot.

But, Edward is a Salesforce Ninja-like us! And, therefore, he is always on the lookout for creative options. As a result, Edward found that a lookup Lightning Component offered by the Flow teamSo, instead of using the old method, he took the following steps:

  1. Navigated to Setup (Gear Icon) | Setup | Process Automation | Flows in Lightning Experience.
  2. Select Screen Flow in the option and click on the Create
  3. Next, he used the Screen element to display the Lookup field. Edward clicked on the Elements tab and dragged and dropped the Screen element onto the canvas. This opens a new window.
  4. On the Screen element, Edward navigated to the Screen Components tab and double-clicked on the Lookup field to add it on to the Screen element – as shown in the following screenshot:
  5. On the Screen overlays preview pane, Edward clicked on the [Lightning Component] field to configure its settings, as shown in the following screenshot:
  6. Edward knows that he can pass values between the flow and the component by using the component properties. As a result, in the end, Edward’s Flow component looked like the following screenshot:
  7. The attributes Edward used in the above components are as follows: 
    • Object API Name – Enter the object API name
    • Field API NameEnter the field API Name that will show up in the list box to represent a record.
    • Label – Enter a label that appears next to the lookup control
  8. In the end, Edward’s Flow will look like the following screenshot:
  9. Edwards, Saved the Flow with name Lookup Example – Flow and close the canvas.
  10. Follow Edward’s footsteps – don’t forget to activate the Flow by clicking on the Activate button!

It’s time to test this feature

Now users can use the Lookup field instead of any other workaround. 

If you have any problem with watching the video then, please click on it and open it in another tab. I hope you can learn from the blog about how to use the Lookup field in the Flow Screen element!! Yes, go ahead! Show off your newly acquired skills to your friends, colleagues, and families!

Please feel free to add constructive comments, insights – and yes, challenges too! – to the blog. Good Luck in your Journey towards becoming a Salesforce Ninja!

Have feedback, suggestions for posts, or need more information about Salesforce online training offered by me? Say hello, and leave a message!

7 thoughts on “Getting Started with Salesforce Flow – Part 12 (What? Use Lookup Field into a Flow Screen Element?!!)

  1. Why did we use OBject Api name to be contact. I am still new with Flows so i am very confused. If we think about a different scenario where can we lookup to Opportunity or custom object?

  2. Hi Rakesh, would you be able to take one step further, and show how the user can lookup a contact, hopefully filtered from the account chosen in above?

  3. Hi Rakesh, Thanks for the detailed solution which i was looking for. Is it possible to pre populate the Lookup field value from the object selected with the lightning component? can you help here? Thanks!

  4. Hi Rakesh, thank you for the solution. I am trying to install this Lightning Component in sandbox but every it is prompting to enter PROD login details. Could you please help? Thanks in advance!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.