How to Call Approval Process From Flow in Salesforce

Using Salesforce Flow, we can automate the call approval process directly instead of manually clicking the Submit For Approval button.

In this Salesforce tutorial, we will learn about the approval process in Salesforce and see How to Call Approval Process From Flow in Salesforce with real-time scenarios and explanations.

What is the approval process in Salesforce?

In Salesforce, the Approval Process is an automated workflow that allows organizations to approve records within Salesforce. We can add action when the approver accepts or rejects the approval. It helps streamline the decision-making for tasks that require approval, such as discounts, expenditures, or contract terms.

Let’s take a Scenario while working as a Salesforce Admin; I was assigned a task to create a flow to automate the process of calling the approval process for any certain condition without clicking on the Submit For Approval button.

To automate the process of calling the approval process automatically instead of clicking the submit for approval button, we need to create a flow.

How to Call Approval Process From Flow in Salesforce

Prerequisites:

1. We need an Approval Process that we can call from a Flow. Here, I have already created an approval process for Opportunity Object.

  • In this approval process, I have added the condition that if the opportunity Amount is greater than 20K, it should be submitted to the Manager to get approved, and if the Amount is greater than 60K, it should be submitted to HR to get approved.
  • When the approver approves or rejects the approval, the Approval_Status_c field on the opportunity object should update accordingly.
  • We need a Unique Name, which we will use in the Flow to pass as the Approval Process Name or ID.
How to Call Approval Process From Flow in Salesforce

Create Record Trigger Flow:

2. Log in to the Salesforce Org. -> Click on the Setup -> Home Tab -> In Quick Find Box, Search for Flows. You will see an option under Process Automation -> Click on Flows.

  • Then, click on the New Flow button to create a new flow.
  • Here, our flow will trigger after creating or updating the opportunity record. To do that, we have to select the Record-Trigger flow. Then, click on the Create button.
See also  How to Create a Related Record from a Salesforce Flow

3. When the Opportunity record is created or updated, that’s why I have selected the Opportunity in the Object field. In Configure Trigger, I have selected A Record is Created or Updated because when we update the record, the flow should trigger on a certain condition.

  • Then, we have to Set Entry Conditions, and in the Condition Requirement option, we have to select All Conditions Are Met(AND) because the following conditions should meet the criteria.
  • Here, the flow has to trigger only when the Opportunity Amount > 20K.
  • Here, we are going to trigger the Approval Process, which is the kind of action we have to select Optimize the Flow for Action and Related Records.
How to Call Approval Process From Flows in Salesforce

4. Now, we are creating the action using the Action Element. To add an action element, click on the + plus icon, and then you will see the Action Element. Then click on the All Category.

  • When you click on it, you need to add an action in the Action field. To submit records for approval, we have to search for the Submit For Approval action. This is an Inbuilt Action or, we can say, part of a Core Action.
  • Then, enter the Label, and the API Name will automatically populate. The description is optional; you can give a short intro about this Action element.
How to Call Approval Process Using Salesforce Flow

5. We have to Set Field Values for the Selected Action. To make it automatic, the following input values are assigned to Submit to Approval.

ActionValues
Record ID$Record>Opportunity>ID
Approval Process Name or IDApproval Process Unique Name.
Submission CommentsIt will be displayed on the Approval History.
Submitter ID$Record>Opportunity>OwnerID.

After that, click on the Done button.

How to Call Approval Process Using Salesforce Flows

6. After setting up all labels and conditions, click the Save button to save the flow. For that, we need to enter the Flow Label. The API Name will automatically populate as we click the text box. The Description is optional; we can introduce our flow Shortly.

  • After Saving the flow, click on the Debug button. Then click on the Activate button; always remember to debug the flow before activating it. It’s good practice to use flow.
Call Approval Process Using Salesforce Flows

Proof of Concept:

7. Here, you can see that I created a new Opportunity record with the triggering conditions of Approval Process and Flow.

  • As per the Approval Process criteria, this record should be submitted to the manager for approval.
  • As per the Flow criteria, the flow should trigger if the record is created or updated and the opportunity amount is> 20K.
See also  Automate Birthday or Anniversary Email Using Salesforce Flow

After the record is saved, the Approval Status field automatically updates to In-Progress according to the approval process. This time, because of the flow, we don’t need to click on the Submit For Approval button.

Call Approval Process From Flow in Salesforce

8. Here, you can see after the record is saved, the Approval Status is changed automatically.

Call Approval Process From Flows in Salesforce

9. As you click on the Approval History there, you will see the detailed process from the record’s submission to approval to the status of Approval to Rejection.

Call Approval Process Using Salesforce Flow

This is how we can automate the approval process instead of clicking the submit for approval button manually and calling the approval process from the flow in Salesforce.

Conclusion

In this article, we have learned about the approval process. I hope you have an idea about creating one. We have also seen how to call the approval process from flow in Salesforce with real-time scenarios and explanations.

You may like to read: