Lookup views and quick find
Two small views decide how people pick a record in a lookup. A lookup view chooses the columns of the Advanced lookup grid, and a quick find view chooses which columns typing searches, so "Berlin" finds the contacts in Berlin.

Our sample data has six contacts called Alex. When somebody assigns a laptop to "Alex", the lookup has to help them pick the right one, and they may only remember that it's the one in Berlin. Two kinds of view handle this:
- A lookup view chooses the columns people see when they pick a record.
- A quick find view chooses which columns typing searches.
Both are ordinary views with a different View type. You make them on the table being picked from: here that's Contact, the table the Asset's Assigned To field points at. Every picture is the real product.
A lookup view
Open the Contact table, go to Views, and select New. Name it Contact Lookup, set View type to Lookup, and tick Default view. Then drag in the columns that tell similar contacts apart: Full Name, Job Title, City and Company Name.

Keep it short. A lookup view is for picking a record, not for reading a report: the name and two or three columns that separate lookalikes are usually enough.
Save it. A table has one default view of each type, so this doesn't change the contact list's default view.
Where the columns appear
Open an asset and type "Alex" into Assigned To. The list under the box stays short: each contact's name with its second line underneath. What's new is Advanced lookup at the bottom:

Advanced lookup opens the lookup view as a grid, with room for every column and pages through the whole table:

Now it's easy to see which Alex is the sales rep in Berlin. Select the row to pick them.
The link only appears when the table has a lookup view. Without one there are no chosen columns to show, so a lookup is just the short list.
While writing this we found that a lookup column in this grid showed the other record's id rather than its name: Company Name read as a long string of letters and numbers. It now shows the company's name.
To give one particular lookup field a different lookup view, select the field in the Form Designer and choose it under Lookup view. Left on Default, the field uses the one you just made.
A quick find view
Now type "Berlin" into the same box:

Nothing, because typing only searches the contact's name so far. Make a second view on Contact: Contact Quick Find, View type Quick Find, Default view ticked, with the columns typing should search: Full Name, Email, City and Job Title.

Save, and type "Berlin" again:

A record matches when any of the columns contains what you typed, in any letter case. So "Sales Rep" now finds the sales reps, and part of an email address finds its owner.
The two views as documents
Both are ordinary view documents. Only viewType tells the platform what each is for:
{
"logicalName": "contact_lookup",
"displayName": "Contact Lookup",
"entity": "contact",
"viewType": "Lookup",
"columns": ["fullname", "jobtitle", "address1_city", "company"]
}
{
"logicalName": "contact_quickfind",
"displayName": "Contact Quick Find",
"entity": "contact",
"viewType": "QuickFind",
"columns": ["fullname", "emailaddress1", "address1_city", "jobtitle"]
}
The lookup view's columns are what Advanced lookup lists, in that order. The quick find view's columns are what typing in a lookup is matched against; their order doesn't matter, and a filter or sort on it is ignored. When one lookup field needs a different lookup view from the table's default, its placement on the form names it:
{ "field": "con_assignedto", "controlProps": { "lookupView": "contact_lookup_it" } }
That is the Lookup view setting in the Form Designer. Every other lookup to Contact keeps using the default.
Three settings, one decision
Picking a record in a lookup draws on three settings of the table being picked from, and it helps to see them side by side:
| Setting | Decides | Where it is set |
|---|---|---|
| Second line | The line under each name in the drop-down | The table's fields, Use as secondary text |
| Quick find view | Which fields typing searches | The table's views |
| Lookup view | The columns of Advanced lookup | The table's views |
All three answer the same question, which one do you mean?, at three moments: while somebody types, while they scan the short list, and when they need to compare rows side by side. Set them together, from the same idea of what tells this table's records apart. A picture and a second line beside every record covers the second line.
What tells records apart
A good set of columns depends on the table. A few that work:
| Table | Quick find | Lookup view |
|---|---|---|
| Contact | Name, email, city, job title | Name, job title, city, company |
| Account | Name, city, account number | Name, city, phone, primary contact |
| Product | Name, product code, supplier | Name, code, price, in stock |
| Enquiry or invoice | Title, reference number | Reference, title, customer, date |
| Room or asset | Name, site, serial number | Name, site, capacity or model |
The quick find column people most often forget is the one they quote over the phone: an account number, a reference, a serial number. Add it, and whoever is filling in a form while somebody reads a number out to them finds the record in one go.
Keep the quick find view lean
Every column in a quick find view widens what matches, because a record matches when any of them contains what was typed. That is helpful up to a point:
- Berlin in a quick find over name and city finds the people in Berlin, which is what you wanted.
- Berlin in a quick find that also searches notes finds everybody who once mentioned Berlin, which probably isn't.
So add the fields people really search by, and leave long text fields out. Only text columns are searched; a number, date or yes/no column in the view is skipped rather than causing an error, so a quick find view can't break a lookup.
Lists search differently
The search box above a list, in a view, matches the table's main column only, the name. It answers which one is called…?. The quick find view is used by lookups, where the job is to pick one record while doing something else. To find records in a list by another field, use Filter, or save a view filtered on it. Work with records in a view shows the list's own search, and Filters with And and Or the filter.
Questions that come up
Does a lookup view decide which records can be picked? Its columns decide what Advanced lookup shows; which records can be found at all is limited first by what the person may read. Adding State to the lookup view makes a retired record easy to spot before somebody picks it.
Can I have several lookup views on one table? Yes. One is the default, used by every lookup that doesn't choose; others can be named by particular lookup fields on particular forms, as above.
Is there a quick find per form? No. The quick find view belongs to the table, so every lookup to it searches the same fields. That keeps the answer to why didn't it find them? in one place.
Do these views travel to Production? Yes. They are views of the table and move with the solution, so a lookup in Production searches the same fields as in Development.
What a quick find view uses
Only its columns. Its filter and sort are ignored, because it answers "what does typing search?", not "what is listed?". What is listed is the lookup view's job.
Only text columns can be searched this way. A number, date or yes/no column in a quick find view is skipped rather than causing an error. Each extra column also widens what matches, so add the ones people really search by.
Both views are part of the table, so they move with your solution like any other view.
Next: a customer timeline.