Get Lookup Field Suggestions for a Specified Object
GET {{_endpoint}}/services/data/v{{version}}/ui-api/lookups/:SOBJECT_API_NAME/:FIELD_API_NAME/:TARGET_API_NAME
When a user edits a lookup field, use this resource to search for and display suggestions for a specified object. You can search for most recently used matches, for matching names, or for any match in a searchable field. You can also specify lookup filter bindings for dependent lookups.
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
dependentFieldBindings | null | The dependent field bindings for dependent lookups. These field bindings represent the lookup filter that restricts the valid values for the field. | |
Specify field bindings in a comma-separated list in the format dependentFieldBindings=<FIELD_API_NAME1>=[FIELD_VALUE1],<FIELD_API_NAME2>=[FIELD_VALUE2]. |
To know whether a field is a dependent lookup, check the Object Info response body for a non-null filteredLookupInfo property. Specify the name and a value for each field in the controllingFields property. Get the field values from the Record response body. Both responses are returned from the /ui-api/record-ui/<RECORD_IDS> resource. |
| page
| null | | The page number. The default value is 1. |
| pageSize
| null | | The number of items per page. The default value is 25.
|
| q
| null | | The term the user is searching for.
When searchType=Search, specify at least 2 characters. A wildcard at the end of the search term is implied. For example, q=ca returns Cat and Cats.
When searchType=TypeAhead, specify at least 3 characters. A wildcard at the end of the search term is implied. You can’t use a ?. |
| searchType
| null | | The type of search to perform. One of these values:
Recent—Return most recently used matches.
Search—Search for records with searchable fields that match the query term.
TypeAhead—Search for records whose names start with the query term.
The default value is Recent. |
RESPONSES
status: OK
{"count":2,"currentPageToken":null,"currentPageUrl":"/services/data/v58.0/ui-api/lookups/Contact/AccountId/Account?searchType=Recent\u0026page=1\u0026pageSize=25","nextPageToken":null,"nextPageUrl":null,"previousPageToken":null,"previousPageUrl":null,"records":[{"apiName":"Account","childRelationships":{},"eTag":"2316c5f4a27ac31b407d91aab610b281","fields":{"DisambiguationField":{"displayValue":null,"value":null},"Id":{"displayValue":null,"value":"001B000000UnQ2yIAF"},"Name":{"displayValue":null,"value":"Dickenson plc"},"Site":{"displayValue":null,"value":null}},"id":"001B000000UnQ2yIAF","lastModifiedById":"005B0000003TOI6IAO","lastModifiedDate":"2017-08-18T14:46:22.000Z","recordTypeId":"012000000000000AAA","recordTypeInfo":null,"systemModstamp":"2017-08-18T14:46:22.000Z","weakEtag":1503067582000},{"apiName":"Account","childRelationships":{},"eTag":"cb5afb4494d9c9f6f81ab0e5f214585c","fields":{"DisambiguationField":{"displayValue":null,"value":null},"Id":{"displayValue":null,"value":"001B000000UnQ2wIAF"},"Name":{"displayValue":null,"value":"Burlington Textiles Corp of America"},"Site":{"displayValue":null,"value":null}},"id":"001B000000UnQ2wIAF","lastModifiedById":"005B0000003TOI6IAO","lastModifiedDate":"2017-08-18T14:46:22.000Z","recordTypeId":"012000000000000AAA","recordTypeInfo":null,"systemModstamp":"2017-08-18T14:46:22.000Z","weakEtag":1503067582000}]}