---
schema_version: "1"
id: f5eb650a1c5114ca66b491bcae4780b982a901168c85d64c6fa4aaa194a9630e
title: Lookup Post Input
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/uiapi/ui_api_requests_lookup_post_input.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_requests_lookup_post_input.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 27bde35ec52f6ad2ad4eb7b665a183b23500ed3275afd7b85abe801aa7f78bc2
description: Get lookup field suggestions.
---
# Lookup Post Input

Get lookup field suggestions.

Example: Search Dependent Lookups for Suggestions using the request body

Some lookup fields have lookup filters that restrict their valid values by referencing fields on the source object. These fields are called dependent lookups. For example, you can filter the Case Contact field to show only contacts that are associated with the account selected in the Case Account Name field.

In the Salesforce UI, this lookup filter is Contact Name: Account Name ID EQUALS Case: Account Name ID. In the User Interface API, lookup filter information appears in the filteredLookupInfo property of the [Object Info](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_responses_object_info.htm#ui_api_responses_object_info "The metadata for an object.") response body, which is returned from several resources, including [/ui-api/record-ui/{recordIds}](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_resources_record_ui.htm#ui_api_resources_record_ui "Get layout information, metadata, and data to build UI for a single record or for a collection of records."). If the filteredLookupInfo property is non-null, the field it describes is a dependent lookup.

In this example, the Case object’s ContactId field has a filteredLookupInfo property containing a controllingFields property. The controlling field is AccountId. To restrict the lookup search, you must pass all controlling fields and their values to the lookups resource in the sourceRecord request body property.

 **"objectInfos" : {**
    ...
    **"Case" : { **      
      "apiName" : "Case",
      ...
      **"fields" : {**
       ...
        **"ContactId" : {**
          "apiName" : "ContactId",
          ...properties removed for space...
          **"filteredLookupInfo" : {
            "controllingFields" : \[ "AccountId" \],**
            "dependent" : true,
            "optionalFilter" : false
          },
          ...
          "sortable" : true,
          "unique" : false,
          "updateable" : true
        },
        ...

To get the value for AccountId, look in the [Record](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_responses_record.htm#ui_api_responses_record "The field data, API name, child relationship data, and record type information for a record.") response body, which is returned from several resources, including [/ui-api/record-ui/{recordIds}](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_resources_record_ui.htm#ui_api_resources_record_ui "Get layout information, metadata, and data to build UI for a single record or for a collection of records."). For example, to retrieve the value of the AccountId field present on the Case 500R0000000bKpBIAU:

GET /ui-api/records/500R0000000bKpBIAU?fields=Case.AccountId

{
  "apiName": "Case",
  "id": "500Z7000000bhdFIAQ",
  "fields": {
    "AccountId": {
      "displayValue": null,
      "value": "001R0000003IG0MIAW"
    }
  },
  ...Some properties removed for space...
}

To filter the suggestions for a dependent lookup, specify the names and values of the controlling fields in the sourceRecord request body property. (This example has one controlling field).

Request body:

POST /ui-api/lookups/case/ContactId
{
    "sourceRecord": {
        "fields": {
            "Id": "500Z7000000bhdFIAQ",
            "AccountId": "001R0000003IG0MIAW"
        }
    },
     "orderBy": \[
        {
           "fieldApiName": "Name", 
           "isAscending":true
        }
     \]  
}

Properties

<table class="featureTable sort_table" summary="">





              <thead class="thead sorted" align="left">
                <tr>
                  <th class="featureTableHeader vertical-align-top " id="d29058e182">Name</th>

                  <th class="featureTableHeader vertical-align-top " id="d29058e185">Type</th>

                  <th class="featureTableHeader vertical-align-top " id="d29058e188">Description</th>

                  <th class="featureTableHeader vertical-align-top " id="d29058e191">Required or Optional</th>

                  <th class="featureTableHeader vertical-align-top " id="d29058e194">Available Version</th>

                </tr>

              </thead>

              <tbody class="tbody">
                <tr>
                  <td class="entry" headers="d29058e182" data-title="Name"><samp class="codeph nolang">orderBy</samp></td>

                  <td class="entry" headers="d29058e185" data-title="Type">
                    <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_requests_list_order_by_input.htm" title="Information describing how to order a related list. This request body supports sorting related lists only by one field. Use this request body to update a related list.">List Order By Input</a>[]
                  </td>

                  <td class="entry" headers="d29058e188" data-title="Description">Information describing how to order the results.</td>

                  <td class="entry" headers="d29058e191" data-title="Required or Optional">Optional</td>

                  <td class="entry" headers="d29058e194" data-title="Available Version">63.0</td>

                </tr>

                <tr>
                  <td class="entry" headers="d29058e182" data-title="Name"><samp class="codeph nolang">sourceRecord</samp></td>

                  <td class="entry" headers="d29058e185" data-title="Type"><a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_requests_record_input.htm" title="A description of a record to use in a request to create or update a record or in a request to check for duplicate records.">Record Input</a></td>

                  <td class="entry" headers="d29058e188" data-title="Description">The source record in which the lookup relationship field is being edited.
                    <p class="p">The presence of the source record “Id” is required within the “fields”
                      property. Accepted values are “null” when creating a new record and a valid
                      record ID when updating an existing record.</p>
                    <p class="p">Some lookup fields have
                      lookup filters that restrict the values they can accept by referencing
                      fields on the source object. These fields are called dependent lookup fields
                      or controlling fields. You must pass all controlling fields and their values
                      to the lookups resource within the “fields” property. </p>
                    <p class="p">To know whether
                      a field is a lookup controlling field, check the Object Info response body
                      for a non-null filteredLookupInfo property. Get the field values from the
                      Record response body. Both responses are returned from the
                      /ui-api/record-ui/{recordIds} resource.</p>
                    Properties “allowSaveOnDuplicate”
                    and “apiName” are not used.
                  </td>

                  <td class="entry" headers="d29058e191" data-title="Required or Optional">Required</td>

                  <td class="entry" headers="d29058e194" data-title="Available Version">60.0</td>

                </tr>

              </tbody>

            </table>

#### See Also

- [Get Lookup Field Suggestions With POST](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_resources_lookup_post.htm "When a user edits a lookup field, use this resource to search for and display suggestions. You can search for most recently used matches, for matching names, or for any match in a searchable field. You must specify dependent lookup field values used by lookup filters in the `sourceRecord` request body parameter.")