---
schema_version: "1"
id: d75b5775d5baf46ca8a9b97f9c25ce2d23f6af68d67233505f92c6c0b8b8eed1
title: Lookup Screen Input Component
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/flow_ref_elements_screencmp_lookup.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.flow_ref_elements_screencmp_lookup.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 157b424c975e909ca87861b1155050ee9da5c73d80b715e14bb4ea32e08fb5ff
description: Let users search for and select existing records in a screen flow. Configure the component with a lookup field and its source object, and store the selected record IDs for use later in the flow.
products:
  - Flow Builder
  - Salesforce Platform
release: "264"
---
# Lookup Screen Input Component

Let users search for and select existing records in a screen flow. Configure the component with a lookup field and its source object, and store the selected record IDs for use later in the flow.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=platform.flow_ref_supported_editions.htm&amp;release=264.0.0&amp;type=5" title="Learn about the editions and user interfaces that support Flow Builder. Some Flow Builder features integrate with other Salesforce products that require additional licenses.">View supported editions.</a></td></tr></tbody></table>

When you configure a Lookup component, you set the component to mimic an existing lookup field on an object so it uses the lookup field’s search and selection behavior. For example, if you're adding an account lookup screen component, use the account lookup field on the Contact object to mimic the functionality. The flow temporarily uses the definition of the standard Contact.AccountId field to enable the account lookup screen component, even though no contact record is created or updated.

![Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/images/icon_example.png)

Example For a Lookup screen component example, review the example at the end of [Get or Process Data Within a Screen Element with Screen Actions](https://help.salesforce.com/s/articleView?id=platform.flow_ref_elements_screen_flow_screen_actions.htm&release=264.0.0&type=5 "Screen actions make your screen elements dynamic by using an autolaunched flow to retrieve or process data. Screen actions reduce the need for you to add elements between screens and reduce the need for users to switch between screens to observe data updates. Because users click though fewer screens, they can finish a screen flow faster. Also, users benefit from screens that react to their interactions, increasing their engagement.")

![Lookup screen component at design time](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/platform_automation/images/flow/flow_screencmp_lookup.png)

## Configure the Lookup Component

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:24%">
          <col style="width:76%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d214282e89">Attribute</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d214282e92">Description</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Attribute" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e89 ">
              <strong class="uicontrol">API Name</strong>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e92 ">
              <p>The API name of the component.</p>
              <p style="margin-bottom:0;">An API name can include underscores and
                alphanumeric characters without spaces. It must begin with a letter and can’t end
                with an underscore. It also can’t have two consecutive underscores.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Attribute" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e89 ">
              <strong class="uicontrol">Field API Name</strong>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e92 ">
              <p>The API name of a lookup field on the source object referenced in Object API
                Name.</p>
              <p>The lookup field referenced in Field API Name must be a field on the object
                referenced in Object API Name.</p>
              <p style="margin-bottom:0;">For example, to add a lookup for an account, find an object that has an account
                lookup field on it. In this case, let’s use the account lookup field on the
                Contact object. The API name of the account lookup field on the Contact object is
                AccountId, so enter <kbd>AccountId</kbd> for Field API Name, then
                enter <kbd>Contact</kbd> for Object API Name.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Attribute" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e89 ">
              <strong class="uicontrol">Label</strong>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e92 ">The text that shows at the top of the component that tells the running user how
              to use the screen component. For example, if you’re adding an account lookup, the
              label could be Select Account.</td>

          </tr>
          <tr class="">
            <td data-label="Attribute" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e89 ">
              <strong class="uicontrol">Object API Name</strong>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e92 ">
              <p>The API name of the source object that has the lookup field referenced in Field
                API Name.</p>
              <p>The source object can be any object that has the type of lookup field that you
                want to use.</p>
              <p>The lookup field referenced in Field API Name must be a field on the object
                referenced in Object API Name.</p>
              <p>To use the Lookup component, the running user of the flow must have the Create
                permission on the source object.</p>
              <p style="margin-bottom:0;">For example, to add a lookup for a contact, find an object that has a contact
                lookup field on it. In this case, let’s use the contact lookup field on the Case
                object. The API name of the Case object is Case, so enter
                <kbd>Case</kbd> for Object API Name, then enter
                <kbd>ContactId</kbd> for Field API Name.
              </p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Attribute" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e89 ">
              <strong class="uicontrol">Disabled</strong>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e92 ">
              <p>If set to true, the user can’t
                modify the value. The default value is false.</p>
              <p style="margin-bottom:0;">This attribute accepts a resource
                with a Boolean value.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Attribute" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e89 ">
              <strong class="uicontrol">Maximum Selections</strong>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e92 ">The maximum number of records that the user can select. The default value is
              1.</td>

          </tr>
          <tr class="">
            <td data-label="Attribute" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e89 ">
              <strong class="uicontrol">Record Id</strong>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e92 ">
              <p>Initially, if Maximum Selections is <kbd>1</kbd> or Maximum
                Selections is greater than 1 and the Record ID Collection field is
                <kbd>null</kbd>, the record ID selected by default for the
                lookup.
              </p>
              <p style="margin-bottom:0;">When a user runs the flow, the value changes to the flow user’s
                selection.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Attribute" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e89 ">
              <strong class="uicontrol">Record Id Collection</strong>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e92 ">
              <p>Initially, if Maximum Selections is greater than 1, the default record IDs for
                the lookup. </p>
              <p>If Maximum Selections is greater than 1 and the Record ID field is
                <kbd>null</kbd>, the first value is the record IDs selected by
                default for the lookup.
              </p>
              <p>You can specify any number of record IDs up to the
                Maximum Selections value.</p>
              <p style="margin-bottom:0;">When a user runs the flow, the value changes to the flow
                user’s selections.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Attribute" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e89 ">
              <strong class="uicontrol">Required</strong>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e92 ">
              <p>If set to true, the running user
                must enter a value. The default value is false.</p>
              <p style="margin-bottom:0;">This attribute accepts a resource
                with a Boolean value.</p>
            </td>

          </tr>
        </tbody>
      </table>

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/images/icon_note.png)

Note If your org has a namespace, add the namespace to the beginning of the object's API name, and the field's API Name. For example, if you have a custom object called Insurance\_Agent\_\_c, and your org's namespace is Acme, enter Acme\_\_Insurance\_Agent\_\_c.

## Store the Lookup Component’s Values in the Flow

The flow stores values automatically. If you store values manually, store the attribute’s output value in a variable.

To store values manually, select **Manually assign variables (advanced)**.

You can store any attribute in a flow variable. The attributes most commonly used are:

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:24%">
          <col style="width:76%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d214282e311">Attribute</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d214282e314">Description</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Attribute" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e311 ">
              <strong class="uicontrol">Record ID</strong>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e314 ">
              <p>If the Maximum Selections value is 1, the ID of the record the user
                selects.</p>
              <p style="margin-bottom:0;">You can store this value in a Text variable.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Attribute" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e311 ">
              <strong class="uicontrol">Record ID Collection</strong>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e314 ">
              <p>If the Maximum Selections value is greater than 1, the list of IDs of the
                records that the user selects. </p>
              <p>If the Maximum Selections value is 1 and Record ID
                is null, the first value in the collection is the ID of the record that the user
                selects.</p>
              <p style="margin-bottom:0;">You can store this value in a Text collection variable.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Attribute" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e311 ">
              <strong class="uicontrol">Record Name</strong>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e314 ">
              <p>If the Maximum Selections value is 1, the value of the Name field of the record
                that the user selects. </p>
              <p>If the Maximum Selections value is greater than 1, the
                value of the Name field of the first record that the user selects.</p>
              <p>You can
                store this value in a Text variable.</p>
              <p style="margin-bottom:0;">This value isn’t populated when the
                Name field of the record is an external object.</p>
            </td>

          </tr>
        </tbody>
      </table>

![Tip](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/images/icon_tip.png)

Tip By default, screen components that run on Lightning runtime version 58 and prior have no memory. If a user enters a value, and then does one of the following, the value is lost.

- Navigates to another screen and returns to the component’s screen.
- Pauses the flow then resumes it.
- Navigates to the next screen and triggers an input validation error.

Setting the attribute enables a flow to remember the value. The flow stores the value automatically. If you store values manually, store the attribute’s output value in a variable.

## Set the Component Visibility

Specify the logic that determines when the flow displays the component.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:24%">
          <col style="width:76%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d214282e416">Option</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d214282e419">Description</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Option" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e416 ">
              <strong class="uicontrol">When to Display Component</strong>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e419 ">
              <p>Configure when the component is displayed by using conditional logic. </p>
              <p>You can set the components to:</p>
              <dl>

                <dt style="font-weight:bold;padding-top:.25rem;">Always</dt>

                <dd style="padding-left:1.5rem;padding-bottom:.5rem;">Always display the component.</dd>


                <dt style="font-weight:bold;padding-top:.25rem;">When all conditions are met (AND)</dt>

                <dd style="padding-left:1.5rem;padding-bottom:.5rem;">Display the component when all of the conditions that you define are met.
                  Define at least one condition.</dd>


                <dt style="font-weight:bold;padding-top:.25rem;">When any condition is met (OR)</dt>

                <dd style="padding-left:1.5rem;padding-bottom:.5rem;">Display the component when at least one of the conditions that you define is
                  met. Define at least one condition.</dd>


                <dt style="font-weight:bold;padding-top:.25rem;">When custom conditional logic is met</dt>

                <dd style="padding-left:1.5rem;padding-bottom:.5rem;">Display the component when the condition logic that you define is met.
                  Define at least one condition and specify condition logic.</dd>

              </dl>
            </td>

          </tr>
        </tbody>
      </table>

## Validate Input

Provide a formula that evaluates whether what the user entered is valid and the error message to display if invalid.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:24%">
          <col style="width:76%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d214282e507">Option</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d214282e510">Description</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Option" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e507 ">
              <strong class="uicontrol">Error Message</strong>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e510 ">Specify the error message that appears below the component if the user enters
              an invalid value.</td>

          </tr>
          <tr class="">
            <td data-label="Option" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e507 ">
              <strong class="uicontrol">Formula</strong>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e510 ">
              <p>Provide a formula expression that returns a Boolean value.</p>
              <p>If the formula expression evaluates to <samp>true</samp>, the
                input is valid. If the formula expression evaluates to
                <samp>false</samp>, the error message appears below the
                component.
              </p>
              <p style="margin-bottom:0;">If the user leaves the field blank and the field isn’t required, the flow doesn’t
                perform the validation. If the user leaves the field blank and the field is
                required, the flow shows the default error message and not your custom error
                message.</p>
            </td>

          </tr>
        </tbody>
      </table>

## Specify the Behavior of Values on Revisited Screens

Specify what this component does when a user enters a value, navigates to a previous screen, and then returns to the screen with this component.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:24%">
          <col style="width:76%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d214282e580">Option</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d214282e583">Description</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Option" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e580 ">
              <strong class="uicontrol">Use values from when the user last visited this screen</strong>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e583 ">The component retains the values that the user specified and doesn’t update the
              values to reflect changes made on previous screens.</td>

          </tr>
          <tr class="">
            <td data-label="Option" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e580 ">
              <strong class="uicontrol">Refresh inputs to incorporate changes elsewhere in the flow</strong>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d214282e583 ">
              <p>The component updates the user-specified values to reflect changes made on
                previous screens.</p>
              <p style="margin-bottom:0;" id="flow_ref_elements_screencmp_lookup__d4559e119"><a name="flow_ref_elements_screencmp_lookup__d4559e119"><!-- --></a>If you pause and then
                resume the flow, the flow retains user-specified values only in Checkbox, Checkbox
                Group, Currency, Long Text Area, Multi-Select Picklist, Number, Password,
                Picklist, Radio Buttons, and Text components.</p>
            </td>

          </tr>
        </tbody>
      </table>

## Considerations

- The Lookup flow screen component isn’t compatible with mobile devices or standalone Aura apps.
- Dependent lookup filters aren't enforced for the Lookup component in a screen flow. A lookup filter is dependent when its criteria reference another field on the current record or a related record. Because the Lookup component collects input independently and lacks a specific record context, it can't evaluate the dependency. Instead of returning an error, the component ignores the filter and displays unfiltered results to the user. Use fixed, static values on the right-hand side of lookup filter criteria instead. However, other lookup filters are enforced exactly as they are on Lightning Experience record pages. When the flow accesses the Salesforce database, all lookup filters are strictly enforced. For example, when the flow runs a Create Records element, the flow fails if the lookup field's value doesn't meet the filter requirements.
- To filter records based on resources and information from the flow, consider using a Choice Lookup component.
- A custom lookup field to a user record isn’t supported.
    
    ![Tip](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/images/icon_tip.png)
    
    Tip To let a flow user choose from a list of user records, employ a standard User lookup field like **CreatedById** or **LastModifiedById**. **OwnerId** isn’t supported.
- At run time, when the flow user types two characters in the field, it shows up to five recent records whose **Name** field matches the query.
- Lookups to an external record aren't supported.
- During run time, if the lookup field defined in **Field API Name** isn’t on an assigned page layout, the lookup component displays `Search undefined...`. To display the correct text, add the defined lookup field to all of the source object’s page layouts that are assigned to running users.
- Invalid Record IDs are ignored. A Record ID is invalid if it isn’t a valid Salesforce Record ID or its key prefix doesn’t match with the field API name object.
- If the Maximum Selections value is 1 and the Record ID Collection and Record ID are both changed, the Record ID takes precedence. The Record ID Collection is ignored.
- If the Maximum Selections value is greater than 1, the Record ID Collection takes precedence when Record ID is populated. But, if Record ID Collection isn’t populated, the Record ID is used to populate Record ID Collection as a single ID
- Relationship fields that are related to more than one object, also known as polymorphic fields, aren’t supported. For example, because a task record’s WhoId field can be related to a contact or a lead, it isn’t supported for this component.
- **Field API Name** and **Object API Name** are case-sensitive.
- The Lookup flow screen component doesn’t support filtering by the source object record type.

#### See Also

- [Standard Flow Screen Components](https://help.salesforce.com/s/articleView?id=platform.flow_ref_elements_screencmp.htm&release=264.0.0&type=5 "Salesforce provides several standard screen components that extend the types of input fields available in screens.")
- [Considerations for Lookup Filters](https://help.salesforce.com/s/articleView?id=platform.fields_lookup_filters_notes.htm&language=en_US)
- [The Enhanced Page Layout Editor](https://help.salesforce.com/s/articleView?id=platform.customize_layoutcustomize_pd.htm&language=en_US)