Flow Lookup Components

So it is really really shitty that the standard lookup component in Flows does not behave the way the standard lookup on page layouts works… So I’ve tried to find another option.

This is only looking at the options that already work for Flows, not ones that work for LWC Apps.

Sadly I did not find anything suitable. So there is still no way to adequately do lookups on Flows. Stick with using Actions! Global and Quick Actions and Related Record Components to use Lookups.

Standard Lookup

Stick a lookup field on a page, or in a Quick Action and expose it via a Detail Page, Related Record Component, or even if you dare use Dynamic Forms and Dynamic Actions (which are still not ready for prime time), the features are pretty similar.

  • See recently viewed records

  • Ordered by most recently viewed record

  • Add new record

  • Clicking into a blank field shows the recently viewed records immediately

  • Shows Search Record note

  • Shows Recent heading

  • X button to remove the current value

  • Edit icon to the right of the field

  • Blue text with hyperlink

The most important feature of a standard Salesforce Lookup is the Add New record feature! If it doesn’t have that it is not worthwhile using it. Unfortunately Lookup is not a LWC Base Component yet AND the SLDS Lookups does not mention the Add New functionality in the standard spec… so I don’t know why all this is, and the speed of getting Lightning moved to LWC on platform and LWC base components released is glacial at best.

The other thing to mention about lookups is how completely hobbled they have been in Lightning since the filters don’t work as optional filters in Lightning. That was such a neat feature and it sucks that we can’t use it In Lightning.

Flows

Now when we build our own solutions with Flows we want EXACTLY the same options as standard but we may want a few other options… like

  • Filters to at least replicate the lightning filter function, but more advanced filters would be lovely.

  • Ensure that sharing rules are respected (or not if it’s a flow in system context for a specific reason).

  • Easy to set up and good documentation.

  • Ensure it pre-fills the existing value then displays correctly after the record is saved with the new value.

Standard Flow Component

For a start it took until just a few releases ago for this to even be a thing, and yet it still does not meet standard functionality. This is a huge fail.

Setup

This is a screen flow on an object named Test__c and looking up to Account.

  • Pretty easy setup.

  • Can output both the ID and the Name which is handy.

  • It gets the help text from the lookup field which is good.

 

However…

  • It doesn’t LOOK like a standard field (border all the way around rather than underline, and label and help text doesn’t look the same).

  • It doesn’t have a new record action.

  • And even if you wanted to add a button on the screen to go to a new screen and add a new record you have to install a button component as there is no standard buttons on Flows, then you have to completely rebuild your New Record screen in Flow. What a waste waste waste of time and effort.

Rating: 6/10

Lightning Universal Lookup Component

By Synebo. Appexchange Link

Says it “looks like standard”, but unfortunately with no Add Record function it does not behave like standard.

A heap of options but a bit difficult to set up. But really great help documentation.

Setup

  • This is the setup to most closely resemble a standard lookup

  • It could really do with a new setup panel using the new Custom Property Editor rather than the a to v labels.

  • Excellent SOQL Filter Features.

  • Can set the width.

  • Can have a query to filter the list and a separate query for the default drop down.

    • Eg show only Accounts created today in the dropdown but they can search for other Accounts.

Usage

  • There is a weird flicker of a search icon before the component renders after page refresh (see if you can spot it at the end of the gif below).

  • The initial search filter is inline like standard.

  • It can show an additional field.

  • I can’t get the search panel to open up… it seems that doesn’t function like standard.

Rating 7/10. If they had a New Record Option it would be a 9.5 out of 10! (Yes, I have emailed them).

Remember to give users access to ALL the l_lookup namespaced Apex Classes for this component to work!

Lex Lookup

By Satrang. Appexchange link.

Look I really really want to like this one but it just falls short. I have emailed them and asked them to explain how it should work or improve the component. It is the ONLY ONE with Add New Record. I would almost use it in a real life scenario.

Setup

  • Their documentation is woeful.

  • They have released a new version but it’s not on the Appexchange yet.

  • It seems that this will work as a lightning page component or a Flow component but I can’t work out how.

  • It has 3 fields that can be used as additional fields (but you can’t do lookups - you can only use fields on the object - so create a formula field for a lookup).

  • It has a unique ID for each lookup… not sure why.

  • No filtering, only limiting the number of results.

  • Unfortunately it doesn’t show the existing record, it only shows the name of the existing value as the default search text. So you will need to handle it if they DON’T change the value in the Flow.

Usage

  • It doesn’t look or behave like standard.

  • But it works good enough if you can train the users to clear the value rather than just click the X icon.

    • But then the x icon comes back after you select a value.

  • The New record icon doesn’t look like standard (this is a simple thing to make your components look as much like standard as possible).

    • But the new Record pop up works well.

    • NOTE: They loose the context of the Flow if they create a new Record, because the New Record opens in a new screen. This will be a huge problem if the lookup is half way through a Flow.

    • And there is no way to turn off the ability to do a New Record.

  • The search popup doesn’t function and it makes a blank record appear (unless I have configured it wrong).

  • I hope I’m wrong and they will get back to me with great answers. It has potential.

Rating 8/10 despite the issues… if you use it in a simple one screen Flow only, or on the first screen of a Flow.

Quick Lookup

By UnofficialSF (Eric Smith). https://unofficialsf.com/lookup/

I had the highest hopes for this one, but unfortunately it’s not ready for prime time. Eric has done an amazing job with his Datatable component and if he had time to give this one a little more love it would be amazing.

Setup

  • Needs a Custom Property Editor.

  • The help docs are a bit light on… if they had the new CPE the Help Docs would make sense then.

  • No New Record option (there is an Issue for it though).

  • Can be turned into a dependant lookup.

  • Confusing as to how to set the current value. (you have to set the variable in Output Value with the selected ID)

  • No secondary field can be shown.

  • Can search on and display something other than Name (eg Website as per the example).

Usage

  • X button doesn’t look like standard.

  • No Help Text.

  • No pop up search page to find more options.

  • Can be quite long unless you enter a Where Clause.

Rating 4/10. Unless you need to do dependent lookups then I can’t really recommend it.

So what to do?

There are no options here that I can recommend out of the box.

  • Use Quick Actions instead of Flows.

  • Use Combo Boxes instead? (if you only have a few lookups).

  • Use one of the great custom LWC components and build them into your Flow.

  • Use Eric Smith’s Datatable to present the list of options to select from. Works really nicely.

Do you have any other suggestions?