Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Summary
This article explains how to troubleshoot lookup control issues in Power Apps model-driven apps. The Simple and Advanced Lookup controls use the Lookup field, its relationships, the assigned view, the entity's Quick Find view, the search string, and any applied custom script to build a FetchXML for retrieving search results.
Issues with this operation usually fall into one of these categories:
Search results are incorrect
If the Lookup control's search results are missing items or include unexpected items, inspect the FetchXML of the outgoing network request that the control makes.
If the FetchXML is incorrect, the problem is that:
The Quick Find view or the view being searched is misconfigured:
- Missing search fields.
- Missing the primary field.
- Using a filter that blocks results.
A client script modifies the control's behavior by using APIs such as addPreSearch or addCustomFilter.
If the FetchXML is correct, but the data returned is incorrect, the issue is on the server, such as a misconfigured relationship. Another possibility is that the user doesn't have correct permissions for some entities, which might not be apparent in the network response other than by an omission of results.
Tip
Search results are listed in the order they're returned from the server. If results aren't in the expected order, then either
- the FetchXML order element has the wrong attribute values, or
- the server is unable to sort the results, such as with virtual entities.
Note
- Selecting the text area (the input box of the Lookup control) shows a list of the most recently used items, not a fresh search.
- Selecting the magnifying glass triggers a search based on your input, showing results that match your search terms. You can configure the control to always perform a search when you select the text area, instead of showing recent items.
Views are incorrect
If an entity or view is missing from the Lookup control's views or results, or the default view is incorrect:
- Verify that the entity is enabled for the app.
- Verify that you have the permissions and roles required to interact with the entity and related entities.
If the addCustomView API is being applied, verify that the
viewIdisn't already used.If the lookupObjects or setDefaultView API is being applied, verify that the
viewIdbelongs to a view that's included in the current app.
Result fields are incorrect
The Simple Lookup control presents the search result fields in the order that they're listed in the entity's Lookup view, with the following exceptions:
- Blank fields are replaced with the next nonblank field.
- Fields beginning with the search string are swapped with the second field.
Note
A multi-entity Lookup control can have results with different orders of fields if the entities' Lookup views have different field combinations.