AUTO-SUBMIT RECORDS FOR APPROVAL USING FLOW
by AR Designs
3 months ago
0
How to automatically submit the record for approval using the salesforce flows.
Let’s take an example, to understand the auto-submission of an approval process using the flows, where the sales reps submit the opportunity record for approval manually to their manager and therefore the record gets approved automatically if the Discount Percentage (number field on Opportunity) on opportunity is less than 15%.
After approval, the final approval actions are performed which include the field updates, sending an email to the opportunity owner.
The field to be updated is ‘Approval Status’ (picklist field on Opportunity) which is set to Approved. If the Discount Percentage is greater than 15% then manager will plan to approve it or not. If the manager rejects the approval, final rejection actions are performed where the Approval Status field is updated and set to ‘Rejected’ and the email alert is sent to the opportunity owner.
Approval process looks like:

Basic requirements of Approval Process:
- To create the new approval process, we have two options Jumps Start Wizard and Standard Setup Wizard. The first one involves less steps to configure and the second one needs more steps as it is to be configured from scratch.
- Specifying the entry criteria, for which the record should be processed for further steps and the Approver for approving it. Also set the record editability properties, to specify who can edit the record after submitting it for approval.
- Specify the fields to be displayed on approval page layout and the submitter.
- After the approval process is ready, we can perform the initial submission steps which include the field updates, email alerts, outbound messages and task creation. Here the record is locked.
- We can define the series of approval steps depending upon the needs and use case, and actions of each step.
- Define the final approval actions and the final rejection actions.
Steps for Creating the Flow
- Step 1 – Setup → Process Automation → Flows
- Step 2 – Click on New Flow
- Step 3 – Select the Record Triggered Flow and Click on Create.
- Step 4 – Select the Object as Opportunity and make the subsequent configurations.
- 1. Configure Trigger A record is created or updated.
- 2. Set Entry Conditions → All Conditions are met → Discount_Percentage__c is greater than 0.
- 3. When to run the flow for updated records → Only when a record is updated to meet the condition requirements.
- 4. Optimize the flow for → After actions and Related records.
- 5. Click on Done.

- Step 5 – Choose the Freeform layout to build the flow.
- Step 6 – From Toolbox on the left Select the Action element.
- Step 7 – Search for the ‘Submit for Approval’ action and select it.
- Step 8 – Give the name of the action. (e.g. – Submit for Discount Approval) Fill the fields as –
- 1. Record Id → {! $Record.Id}
- 2. Toggle the button in Approval Process Name or ID field and enter the name of the Approval Process. You can also give an id of your approval process.
- 3. Keep the rest of the fields as it is, we don’t need them now.
- 4. Click Done.
The use of the rest of the fields here are –
- 1. Next Approver IDs – This field is used to assign the approval request to the user specified in the field when approval process doesn’t assign the approver.
- 2. Skip Entry Criteria – It is used to skip the entry criteria of an approval process and create the approval request.
- 3. Submission Comments – If you want any comments to be associated with your approval request, you can specify them here. The value in this field can be used in the email templates as a merge field ({!ApprovalRequest.Comments}) to send an initial approval request email.
- 4. Click Done.
- The step 8 should look like this:

- Now we are done with creating the flow. Save the flow with an appropriate name and activate it.