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

2 replies
  1. Gabriel Hobbs
    Gabriel Hobbs says:

    This is a great audition. I am looking to use this lookup field to help someone find an account name. I tried to configure the parameters on the screen component, but when I tried debugging the flow I could not see any input field. Could you help me see how I would configure the screen component for searching an account name?

    Reply
  2. Jeremy G
    Jeremy G says:

    Hi – thansk for this – really helpful. I have a Custom Object (Subscription__c) which has a lookup of account (ie an account has many Subscriptions.

    In my opportunity I have a lookup to subscription – this has a filter (Subscription: Account ID EQUALS Opportunity: Account ID)

    So in my Opportunity lightning page, I can select an account – then only be presented in the lookup with Subscriptions for that account. I want to do similar in flow, but when I use Opportunity.Subscription lookup in flow, I get no values in my lookup (I assume because it doesn’t know the Account ID).

    many thanks

    Reply

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply