Print this page

How to auto populate Look up Field using Process Builder

Knowledge Article Number 000220643
Description While using workflow Field update, you cannot update the value in a Lookup field. However, this requirement can be accomplished by creating a Process via Process Builder.
Resolution Below mentioned is an example which shows how to update Account look up field on custom object where you also have look up to Contact. Also, consider that the user will select contact in contact look up and the process builder would update the Account look up with Contact’s account.

Suppose you have a custom object with lookup relationship to Accounts as well as Contacts. And you wish to auto populate Account field with Contact’s Account. Follow these steps:

Step 1: Create a Process
1.    Click on your Name | Setup | App Setup | Create | Workflow & Approvals | Process Builder
2.    Click ‘New’ to create a new Process
3.    Define ‘Process Name’, ‘API Name’ and  (Optionally) ‘Description’
4.    Click Save

Step 2: Choose Object and Specify When to start the Process
1.    Click ‘Add Object’ Select the Object on which you want to create the Process
2.    Under ‘Start the process’, select "when a record is created or edited"
3.    Click Save

Step 3: Define Criteria
1.    Click ‘Add Criteria’
2.    Define the ‘Criteria Name’
3.    Under ‘Criteria for Executing Actions’ select ‘Conditions are met’
4.    Under ‘Set Conditions’ select the Contact field--> Select Operator as "Does not equal"--> In Type select "Global Constant" --> In Value select $GlobalConstant.Null
5.    Under ‘Conditions’ select ‘All of the conditions are met(AND)’
6.    Click Save

Step 4: Define Immediate Actions
1.    Click ‘Add Action’ under Immediate Actions
2.    Select the Action type as ‘Updated Records’
3.    Define Action Name
4.    Click Select a record to update and choose the object whose record needs to be updated with this Process
5.    Under  ‘Criteria for Updating Records’ select "No Criteria"
6.    For ‘Set new field Values’ select the field as  ‘Account’ (which we need to update), ‘Type’ should be ‘Reference’ In ‘Value’ first select the Contact> and from Contact ->AccountID
7.    Click Save

Step 5: Activate the Process
1.    Click ‘Activate’ at the top right hand corner of the screen to activate the process
2.    Click ‘Ok’ on Activate Version screen

Your Process is now active and would help you to update value on the Lookup field on Account Object.

promote demote