Newer Version Available

This content describes an older version of this product. View Latest

Get Lookup Field Suggestions for a Specified Object

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.

This resource is designed for future API versions. This resource filters results by object for lookup fields that have a polymorphic target object. In API version 41.0, none of the supported standard objects have a lookup field with a polymorphic target object. However, you might want to use this resource to get a simpler response. You might also want to write a general lookup component that works with future versions of User Interface API, which is likely to support more standard objects.

Note

Resource
1/ui-api/lookups/{objectApiName}/{fieldApiName}/{targetApiName}
  • objectApiName—The API name of a source object.
  • fieldApiName—The API name of a lookup field on the source object.
  • targetApiName—The API name of the target (lookup) object.
Available Version
41.0
HTTP Method
GET
Example
See Get Lookup Field Suggestions.
Request Parameters
Parameter Name Type Description Required or Optional Available Version
targetApiName String[] The API name of the object that you want results for. The name must correspond to one of the target objects of the lookup field. If not provided, by default, results for all target objects of the lookup field are returned.

If targetApiName isn’t specified, then the field configuration is used. If the field is polymorphic, several queries are considered and you receive results for every target that can lead to performance issues.

Note

Optional 59.0
dependent​FieldBindings String[] 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={fieldApiName}​={fieldValue},{field2ApiName}={field2Value}.

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/{recordIds} resource.

Optional 41.0
page Integer The page number. The default value is 1. Optional 41.0
pageSize Integer The number of items per page. The default value is 25. Optional 41.0
q String 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 ?.

Required if searchType is TypeAhead. 41.0
searchType String 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.

Optional 41.0
Response Body
Record Collection