The New Lookup Component

In Winter ’20, Flow adds a Lookup Component.

This component includes type-ahead search, and a list of recently chosen records. Here are the input parameters that you can pass in to it:

You configure it by pointing it at an existing Lookup field using the Object API Name and Field API Name fields. If you want to set its initial value, you can pass in a recordId, and you can make the field required.

Using Lookup Filters

You can make use of Lookup Filters with Lightning Flow. The filter does not (unfortunately) act before the list is rendered for the user. Instead it acts when the corresponding record is saved. Let’s walk through an example:

My Ships__c custom object has a Captain__c custom field that’s a Lookup to Contacts:

The Lookup control used on Flow screens is the same one used on Lightning record pages. Here’s what it looks like on a Lightning record page:

…and here’s how it looks on a Flow screen:

Suppose I add a Lookup Filter that filters out David Green:

One thing to note is that caching may cause it to take several minutes for the lists to update. I had to wait about 10 minutes after creating this Lookup Filter before David Green disappeared from the lists. However, effective immediately, if I selected David Green and tried to save the record in either a record page or via Flow, I would get an error message like this:

Once any caching refreshes, though, values that are blocked by the filter will not be visible in the Lookup