Tap into richer lookups with the Quick Lookup Component
This Post was most recently updated on: 7/6/23
Version 1.2.0
Evan Ponter added an output attribute to store the Name of the selected record
ajfmo-cfg fixed this bug “Cannot read properties of undefined (reading ‘toLowerCase’)”
Version 1.1.0
Andy Haas has corrected these issues:
– If the menu is open and the user clicks out of the component the menu will close.
– If parent lookup is cleared the child component(s) will be cleared along with their filters
Current Version: 1.2.0
Introduction
This Lookup component complements the Lookup component that is standard in Flow by providing additional power and flexibility.

Credits
This started out as the excellent Lightning Lookup control by Opfocus. Later it was enhanced by several members of the Flow community. The chief maintainer is currently Eric Smith.
Basic Attributes
Object Name: Type the name of the object that you want this control to lookup. You can use custom objects but don’t forget the “__c”
Display which Field: You get to choose which field actually shows up in the combo box and gets searched on. Usually you’ll just want to type “Name” here but you can use any text field
Field Label: This is the label of the control itself
Output which value?: You can separately decide which field should be extracted from the selected object and passed to Flow. For example, you might want to display Name but output Id because Id is easier to work with for some Flow Actions.
There’s also an Output Value attribute that’s used on the Output tab to map your selected value to a Flow variable.
Filtering the Lookup Choices
There are several powerful filtering mechanisms built into this component. You probably won’t need to use all of them at the same time.
Filter Using Flow Variables This allows you to specify the name of the specific field you want to filter on. It’s easy but basic.
Filter using a SOQL ‘where’ clause This allows richer filtering. See ‘Where Clause Usage’ below
Dependent Filtering
You can stick two of these components on a screen and have the second component filter on the selection set in the first component. See example 2 below
Multiple Dependent Filtering
You can include multiple Parent/Child groupings on a single screen by identifying each Parent component with a unique ID and specifying the related Parent ID for each Child component.
This component exposes the following attributes that can be set in Flow:
Attribute Reference
Basic Attributes
- label=”I1_Object Name” This is the actual object that will be looked up
- label=”I2_Display Which Field?” This is the field that will show up in the list box to represent a record. It defaults to “Name”
- label=”I3_Field Label” This is just the label that appears next to the lookup control
- label=”I4_Output Which Field as Value?” This is the field you actually want saved into the Output Value attribute. It defaults to Id so you can have an Id to use for lookups, but you may want to change it to Name or some other value.
- label=”O1_Output Value” This will hold the value that is selected, for use downstream in the flow. If a value is provided as an Input parameter, it will be passed to the O1_Output Value Output parameter if no record is selected.
Advanced Attributes
- label=”I5_’Parent’, ‘Child’ or ‘Both’ Lookup?” If Both or Child is entered, the filter value will be replaced by the value returned by the referenced Parent lookup on the same screen.
- label=”I6_Filter on which field?” This is the name of the field to filter the lookup on.
- label=”I7_Filter Value” This is the filter value for the lookup.
- label=”I8_Search this Field instead of Display Field” Allow a different field to be searched on rather than the default Display Field (Feature Documentation)
- label=”Where Clause” allows the input of a “where” SOQL style filter to limit which values are available for selection.
- label=”Default” You can specify a default value placeholder in the lookup field
- label=”Component ID” You can group multiple Parent/Child components on a single Flow screen. Add a unique value here for each Parent/Both Lookup.
- label=”Parent ID” For a Child or Both Lookup, enter the Component ID of its Parent Lookup here to link them together.
Here’s an example of a configured component:
Default Values
OPTION 1
You can enter a default value for the input field (I2_Display Which Field). When provided, it will override any WhereClause and display the default value as Placeholder text in the input field. You will still need to select the dropdown then select the single value that is displayed. If you start to overtype the input field, the default value will be cleared and the WhereClause (if provided) will be reset and the field will act like a normal filtered lookup with search.
OPTION 2
Provide INPUT values for the following two parameters:
Default Value: (whatever placeholder text you want displayed in the input box – this should match the format of the I2_Display Which Field? parameter)
O1_Output Value: The value to be passed out through the O1_Output Value OUTPUT parameter if no value is selected in the input box (This should match the format of the I4_Output Which Field as Value? paraameter)
Example: Looking up an Account, defaulting to the Account Name of “ACME Company”. Assume the RecordId for ACME Company is stored in the flow variable vDefaultId.
[Input Section]
- API Name: AcctLookup
- Component ID:
- Default Value: ACME Company
- I1_Object Name: Account
- I2_Display Which Field? Name
- I3_Field Label: Account
- I4_Output Which Field as Value? Id
- I5_ Parent or Child Lookup?
- I6_Filter on which field?
- I7_Filter Value:
- O1_Output Value: {!vDefaultId}
[Output Section]
- O1_Output Value: {!vSelectedAccountId} (a text variable)
Where Clause Usage
Input is dependent on the fields available for the object selected for “Object Name”.
For example, if you wish to return only accounts of type “Vendor” or “Partner” you could enter the Object Name: “Account” and the where clause: “Type=’Vendor’ or Type=’Partner'”
Filtered Lookup Examples
Example 1: Lookup a Case filtered by an Account where the ID is passed into the flow variable vInputAcctId
Example 2: Lookup an Account and a Contact on the same screen and only select from Contacts from the selected Account
Version 1.2 Enhancements
Version 1.2 now outputs the displayed value for use later in the flow. It addresses the following use case: I have a Quick LookUp component on a Flow screen that allows for selecting an Account record. The options needed to be filtered down using a WHERE clause to limit the results based on a record that was selected earlier in the flow. The record Id output is used during the creation of a new Opportunity record to relate that record to the Account. I wanted to display a confirmation page at the end of the flow that shows all the values specified during the flow. Displaying the Account Id would not be the best user experience here – I wanted to show the name of the record instead. Since the Quick Lookup component already had all the information, I wanted to be able to reference it in the flow without having to add a Get Records element to retrieve it.
Here is the confirmation page that uses the Output Display Value (Account.displayedValue) from the Quick LookUp component:
Install this Component Into Your Org
7/5/23
Version 1.2 7/5/23 Production Sandbox
Older Versions
9/18/22 – V1.1.0 Production Sandbox
Courtesy Andy Haas
if the menu is open and the user clicks out of the component the menu will close.
If parent lookup is cleared the child component(s) will be cleared along with their filters
Resolves Following Issues:
#878
#875
#962
6/30/22 – Luca Bassani – Version 1.0.4
Apex Class API Versions updated to 55.0 to support newer Objects (Luca Bassani)
Production or Developer Version 1.0.4 (Quick Lookup)
Sandbox Version 1.0.4 (Quick Lookup)
6/11/22 – Eric Smith – Version 1.0.3
Adjusted bottom margin to match that of standard flow screen input components
Production or Developer Version 1.0.3 (Quick Lookup)
Sandbox Version 1.0.3 (Quick Lookup)
8/29/21 – Eric Smith – Version 1.0.2
Updated to API Version 52.0 to support more standard SObjects.
Production or Developer Version 1.0.2 (Quick Lookup)
Sandbox Version 1.0.2 (Quick Lookup)
6/18/21 – Eric Smith – Version 1.0.1
I have refactored the lookupFSC component to a new version called Quick Lookup. The new version is built using a Generation 2 unmanaged package and should no longer have any upgrade issues. You can install and use the new version without having to delete or change any currently active flows.
4/15/21 – vijayignatius – Version 2.40
Added new Attribute – I8_Search this Field instead of Display Field
3/16/21 – Eric Smith – Version 2.34
Fixed a bug that caused the input to disappear when used in a Flow in a Community
12/3/20 – Eric Smith – Version 2.33
Now supports multi-level Parent/Child lookups. A lookup can now be both a Child lookup and a Parent lookup.
Examples:
Parent Lookup on Account (PARENT)
Child Lookup on Contact based on the selected Account (BOTH)
Child lookup on Case based on the selected Contact (CHILD)
Multi_level_lookup (Sample Video)
12/3/20 – Now supports multi-level Parent/Child lookups. A lookup can now be both a Child lookup and a Parent lookup. (v2.33, Eric Smith)
3/7/20 – Fixed bug with Required not working (v2.32, Eric Smith)
10/29/19 – With the new release of Winter ’20, you will need to make sure you select the “Manually assign variables (advanced)” checkbox and set your output parameters to variable resources you have created in your flow.
7/1 Bug Fixes- Error handling for Required attribute & handle ‘ character in a field value (Install package v2.3)
3/22 Bug Fixes (Install package v2.2)
3/6 Bug fix (removed jQuery)
2/23 Misc changes.
8/11 Added ability to group multiple Parent/Child components on a single flow screen. Eric Smith – August 2018
7/22 Added ability to set default: You can enter a default value for the input field (I2_Display Which Field). When provided, it will override any WhereClause and display the default value as Placeholder text in the input field. You will still need to select the drop-down then select the single value that is displayed. If you start to overtype the input field, the default value will be cleared and the WhereClause (if provided) will be reset and the field will act like a normal filtered lookup with search. Eric Smith – July 2018
6/15 Another fix for the jquery issue. also fixed the default value for I4_Output Which Field as Value?
6/11 Another try at fixing the jquery issue. also Eric fixed a Parent Child bug.
6/3 the Summer version was also published accidentally without jquery! fixed now.
5/7 released new managed package version with some bug fixes
4/15 Published v1.6 adds two different ways to filter the results (where clause and specific field) and allows Dependent Lookups, courtesy of @datapharmer and @ericrsmith35
2/28 Published V1.4 Fixed missing JQuery in package to eliminate “Hover” bug
Previous Versions
Production or Developer Version 1.0.3 (Quick Lookup)
Sandbox Version 1.0.3 (Quick Lookup)
Production or Developer Version 1.0.1 (Quick Lookup)
Sandbox Version 1.0.1 (Quick Lookup)
—————————————–
Production or Developer Version 2.40
Sandbox Version 2.40
Production or Developer Version 2.34
Sandbox Version 2.34
Installation (Unmanaged v2.33)
Installation (Managed v2.2)
Source Code
Sample Component Setup
The flow screen image at the top of this page includes 5 lookup components. The Primary Contact(2) is a child of the Bill To Account(1) and the Delivery Contact(4) and Service Address(5) are children of the Deliver To Account(3).