Loading
Connect in real time with the Trailblazer Community in Slack Open BetaRead More

Auto-populate the Lookup Field with Salesforce Flows

Publish Date: Oct 5, 2026
Description

These are the steps to auto-populate lookup fields using Salesforce Flows.

Resolution

This article explains how to automatically populate an Account lookup field from the selected Contact on a custom object in Salesforce by using a record-triggered Flow. The Flow runs when a record is created or updated and the Contact lookup contains a value.

Create the Record-Triggered Flow

  1. Go to Setup | Process Automation | Flows | New Flow.
  2. Select Record-Triggered Flow.
  3. For Object, select the custom object that contains the Contact and Account lookup fields.
  4. For Trigger the Flow When, select A record is created or updated.

Set the Entry Condition

  1. Set the following condition:
    • Field: Contact
    • Operator: Is Null
    • Value: False
  2. For When to Run the Flow for Updated Records, select Every time a record is updated and meets the condition requirements.
  3. For Optimize the Flow for, select Fast Field Updates.
  4. Click Done.

Add an Assignment to Populate the Account

  1. Click + | Assignment.
  2. Enter a Label, for example: Populate Account from Contact.
  3. Set the following value:
    • Variable: $Record.AccountId
    • Operator: Equals
    • Value: $Record.Contact > Account ID
  4. Click Done.

For a custom lookup field, the assignment appears similar to: Account = Triggering Record > Contact > Account ID.

The Flow now populates the Account lookup field with the Account associated with the selected Contact.

Save and Activate the Flow

  1. Click Save.
  2. Enter a Flow Label, for example: Auto Populate Account from Contact.
  3. Click Activate.

The Flow now runs whenever the custom object record is created or updated and the Contact lookup contains a value.

Knowledge Article Number

000387578

 
Loading
Salesforce Help | Article