Sub topic 10
Global search, recent items, and favorites
This chapter covers the three fastest ways to reach a record in Lightning Experience: the global search box, the Recent items list, and favorites. It assumes you can already open an app, use the navigation bar, and open a list view and a record page. Those topics come from earlier chapters. You also need a user who can view standard objects such as Accounts and Contacts.
Where search fits
Navigation through apps, tabs, and list views is browsing. You pick a place and look through what is there. Search is the opposite. You type what you remember and let Salesforce find it. The two features below remove clicks from the browsing path:
- Recent items remember where you have been.
- Favorites remember where you choose to return.
Global search sits in the header at the top of every page, so it works the same in every app. It is not tied to the current app's navigation items. You can find an object that is not in the current app, as long as your profile and permissions let you see it.
Using global search
Opening the search box
Click the search box in the header, or press the keyboard shortcut for your browser and platform. Before you type anything, the box already shows a dropdown. That dropdown lists items you used recently, so you may not need to type at all.
Instant results
As you type, Salesforce shows a short list of suggestions below the box. This is the instant results panel. It has these parts:
- Records that match the text, grouped by object.
- Suggested searches, which complete your phrase.
- Recent items that match what you typed.
If the record you want is in the panel, click it. You skip the results page entirely.
The full results page
Press Enter to open the search results page. It shows matches grouped by object. The object with the most relevant matches for you is shown first. Other objects appear in a list on the left side, so you can jump between them. Each object section has these features:
- A short table of the top matches with key fields.
- A link to see all matches for that object.
- Filters that narrow the matches by field values, such as owner or status.
Two points often cause confusion. First, results show only records you can see. Sharing rules and field-level security apply, so a coworker can get different results for the same text. Second, search does not run against every field. It looks at fields that are searchable for that object, mostly names, titles, and similar text fields. A value in a long text area may not match.
Scoped search
You can narrow a search to one object. Open the search results page, then select an object from the left list. Some searches also let you use the scope dropdown next to the search box. Use a scope when a common word returns hundreds of matches across many objects.
Search terms and wildcards
Search is not case sensitive. It handles partial words in a limited way, and it supports wildcards:
| Pattern | Meaning | Example | Matches |
|---|---|---|---|
| `*` | Zero or more characters | `acm*` | Acme, Acme Corp, Acmeware |
| `?` | Exactly one character | `Sm?th` | Smith, Smyth |
| `"..."` | An exact phrase | `"Acme Corp"` | Records with those words together |
Keep these rules in mind:
- A wildcard works best at the end of a term. A wildcard at the start can be slow or limited.
- Single-character terms rarely produce useful results. Use at least two characters.
- Special characters such as
?,*, and quotes have meaning in search. To find them literally, put a backslash before the character.
Search results and the SOQL view
Searching is different from filtering a list view. A list view returns every record that meets exact conditions, and you can compare it to a SOQL query:
SELECT Id, Name, Industry
FROM Account
WHERE Industry = 'Technology'
ORDER BY NameGlobal search works like a text lookup. It scores matches by relevance, and it considers what you have used before. A list view is complete and predictable. Search is fast and approximate. Use a list view when you must see all Technology accounts. Use search when you remember part of a name.
| Need | Better tool | Reason |
|---|---|---|
| Every record that meets a condition | List view | Exact, complete, sortable |
| One record, partial name known | Global search | Fast, no setup |
| A record you opened an hour ago | Recent items | No typing |
| A record you open every day | Favorites | Stays until you remove it |
Recent items
Salesforce keeps a history of records and list views you open. You see it in three places.
- The search box dropdown. Click the box without typing and recent records appear.
- The Recent list view on an object. Each object has a list view named Recent. It shows records of that object that you viewed or created lately. The URL for the Account version appears below.
- The Recently Viewed item in a navigation menu. In an app that has it, the list shows records across objects.
/lightning/o/Account/list?filterName=Recent
/lightning/r/Account/001XXXXXXXXXXXXXXX/viewThe first URL opens the Account list view named Recent. The second opens the view page of one Account record, where 001XXXXXXXXXXXXXXX stands for a real record Id.
Recent behavior has some limits:
- The history is per user. Other users do not see yours.
- The list is capped, so older entries drop off as you view new records.
- Recent shows records you viewed, so it is not the same as records you own or changed. For those, use the list views My Accounts or a similar one.
- A record that was deleted, or that you can no longer access, disappears from the list.
Favorites
Favorites are shortcuts that you place yourself. You can favorite a record, a list view, a report, a dashboard, or another page that Salesforce lets you mark.
Adding a favorite
- Open the page you want to keep, such as an Account record.
- Click the star icon in the header, next to the search box.
- Confirm or edit the name, then save.
The star turns solid when the page is a favorite.
Using favorites
Click the star icon to open the favorites list, then click an entry. Favorites work from any app, since the header is shared.
Managing favorites
Open the favorites list and use the edit option to rename entries, reorder them, or delete them. You can also group related entries into folders in some orgs, so a long list stays readable. Renaming only changes the label you see. The link still points at the same page.
What favorites do not do
- They are personal. Other users do not see them, and you cannot share them from the favorites list.
- They store a page, not a search. If you favorite a list view that you then change, the favorite shows the changed view.
- If someone deletes a record or removes your access, the favorite fails when opened.
Practical workflow
Combine the three tools in a routine:
- Start with the search box dropdown. If the record is in your recent history, click it.
- If not, type two or three characters of the name and check the instant results.
- If the record is not there, press Enter and filter the full results by object.
- Once you notice that you open the same record or list view daily, add a favorite.
For example, a support lead might favorite the Open Cases list view and the Support dashboard. Everything else comes from search and the Recent list.
Common problems
| Symptom | Likely cause | What to try |
|---|---|---|
| A record exists but is not in results | You lack access, or it was just created | Check sharing, wait briefly, or open it from a list view |
| Search returns too many objects | The term is common | Scope to one object, or use an exact phrase in quotes |
| Search misses text you know is in a note | That field is not searchable | Use a list view filter or a report instead |
| A favorite shows an error | The record was deleted, or access was removed | Remove the favorite and ask an admin about access |
| Recent list is missing an item | It was pushed out by newer items, or it was never opened | Search by name |
| Wildcard search is slow or empty | The wildcard is at the start of the term | Move it to the end or type more characters |
Developer note
The pages above are also destinations for code. A Lightning Web Component can open the Recent list or a record using the same URL shapes, which a later chapter covers. Favorites and search results are user features, so they are not set from a component. What you can reuse is the target: a list view name and a record Id.
Exercise
A colleague says global search did not find an Account that you can see in the Recent list. Give two reasons the colleague might not see it, and say what the colleague should try instead.
Show answer
First, the colleague may lack access to the record because of sharing rules or field-level security, since search returns only records the user can see. Second, the record may have been created a moment ago and not yet indexed. The colleague can ask an admin to review access, wait and search again, or open a list view that includes the record.
Exercise
You need all Accounts where Industry is Technology, and you also need to jump quickly to one Account whose name starts with "Acm". Which tool fits each need, and why?
Show answer
Use a list view filtered on Industry = Technology for the first need, because it returns every matching record. Use global search with "acm*" or the instant results panel for the second need, because it is faster for a partial name. A favorite would only help if you open the same record often.