Help Center

Defaulting an Approver Based on Another Field


If you want to default an Approver based on the value in another field, using Process Builder is the best way to handle this. In this example, we want to default an Approver in an ECO's Lifecycle based on another field on the Change object, but these steps can work on similar use cases involving Approver default values.

This task will consist of a few relatively simple steps:

A. Create a New Process using Process Builder

B. Add Object to the Process

C. Add Criteria for the Process

D. Add the Action

E. Activate the Process


FYI - Process Builder:

Process Builder is a Salesforce automation tool. For users who are familiar with Workflow Rules, the Process Builder is the next generation. Similarly to workflow rules, Process Builders allows automatic action to take place when a user creates or edits a record based on defined criteria. Traditional workflow can still be utilized in parallel, however, Process Builder gives you the ability to do things that workflow can’t. 

With Process Builder, you can:

  • Create a record of any object type
  • Update any related record—not just the record or its parent
  • Use a quick action to create a record, update a record, or log a call
  • Invoke a process from another process
  • Launch a flow—you can’t schedule this action with workflow
  • Send an email
  • Post to Chatter
  • Submit a record for approval

A. Create a New Process using Process Builder

1. Click Setup in top right corner.


2. In the Setup Search Field, type Process Builder. Then click on Process Builder below the Create > Workflows & Approvals menu.


3. Click New in top right. If you have no previous processes created, your screen will look like the below.


 4. In the new window, enter your Process Name. Click or tab over into the API Name field and it will populate. Use the Description field to describe in longer form what exactly your process will do.

The Process Starts When picklist is asking what exactly will trigger this process to run. Populate this value based on your use case.

Click Save.


In this example, I want to default the "Responsible Engineer" value on the change object as an Approver on the same Change object, but only in the "In Approval" Phase. So my trigger would be when the "Responsible Engineer" field is populated - i.e. When a Record Changes.



B. Add Object to the Process

1. Next, we need to tell the Builder which object to run the Process on. 

Click Add Object. 

In this example, we're working the Change object.


2. We want this process to run whenever a record is created or edited, so we will select this.

3. We will check "Yes" for Recursion in this example. But be careful when using this option! You can pretty easily create unnecessary reevaluations of records.

For help decided if Recursion should be chosen in your use case, see this article:

4. Click Save.


C. Add Criteria for the Process

1. Now we need to add Criteria to our process -- we need to tell the system how to choose the records it will update.

Click Add Criteria.


2. Over on the right, we will let the system know which records should be updated. 

In this example, I only want to populate Change items which have Lifecycle Statuses which occur before the Approved stage. So I have filled in the Criteria Name as such. 

Select Criteria for Executing Actions. In this example, we have a list of criterion which the record must meet in order to be updated, so we will select Conditions are Met. 


3. Now, we will identify those criterion. On line 1, click into the Field field. 

For our example, we want to identify the records with phases we do not want to update.

So I will select the Field called Phase Name.

And click Choose.


4. Then I will specify the records that we're updating, the Phase Names Do Not Equal the String (text) value "Approved."


5. Because we have two other Phase Names Criteria, we will repeat steps 3 and 4 twice more. Once for the "Does Not Equal Implemented" and another for "Does Not Equal Canceled."

6. In our example, Criteria Line 4 will specify that we only want to affect records who's "Responsible Engineer" field is currently blank. 

Click into the Line 4 Field field. Select Responsible Engineer, as below and click Choose.


7. Because we want this field to be blank, we will select the operator Is Null.

Select Boolean as the field type and False as the value.

8. Our example requires that all of our listed conditions be met, so we will select All of the Conditions Are Met (AND).


9. Click Save.


D. Add the Action

1. Now that we've established which records should be updated and when, we need to tell the system what to do! We will specify what exactly what the update should be.

Below "Immediate Actions," click Add Action. 


2. Over on the right, we'll fill in the Action definition.

In order to default an approver, we need to use a specific Apex Class.

Select Apex as your Action Type.

Name your Action - for our example, we've named it Add Responsible Engineer as Approver because I want the process to default the value from the Responsible Engineer field as an Approver.

Be sure to select the Set Workflow Approvers on Criteria as your Apex Class.

Click Save.



3. Now we're going to specify exactly what to update. This Apex Class requires three important variables: Record ID, Phase Name, and User or Group Name.


4. For Line 1 Record ID, select Field Reference as the Field Type. 

Click into the Value field and the below pop-up will appear.

Select the Record ID on the Change object.

Click Choose.


5. For Line 2 Phase Name, select String as the field type.

Click into the Value field and the below pop-up will appear.

Select the Phase Name.

Click Choose.


6.  For Line 3 User or Group Name, select Field Reference as the field type.

Click into the Value field and the below pop-up will appear.

Select the Username.

Click Choose.


7. Click Save.



E. Activate the Process

1. Click Activate at top right.


2. We get a notification that our Process will override any older versions. 

Click Confirm.



Have more questions? Submit a request


Please sign in to leave a comment.