How to Use the Submit for Approval Action in Flow

How to Use the Submit for Approval Action in Flow

In Salesforce, an approval process is a workflow automation feature that defines a sequence of steps for record approval. During the approval process, designated approvers can review, approve, or reject the submitted records. While the standard button is the most common method for submitting a record for approval, it is also possible to automate the process using flow. Here is how to utilize the 'Submit for Approval' core action within flow.

Input Values of the Submit for Approval Action

Add an action element and search for Submit for Approval. Then, set values for the action.

Submit for Approval Action
  • Record ID: This is the Id of the record that you want to submit for approval. You must set this input value.
  • Approval Process Name or ID: Set the API name or Id of the approval process to run against the record. This input value is optional. If you don't set a value, system uses the first approval process whose entry criteria the record satisfies.
  • Next Approver IDs: If your approval process allows manually choosing the approver, you can use this input value. This parameter accepts collection variables of type Text that include exactly one item. You can set the Id of a user or a group.
  • Skip Entry Criteria: If you set this parameter to true, system doesn't evaluate the record against the entry criteria of the approval process. In this case, you must provide a value for Approval Process Name or ID.
  • Submission Comments: This is an optional text value for setting the submission comments. If you set it, it will appear in the approval history of the record.
  • Submitter ID: This optional parameter is the Id of the user submitting the record for approval. If you don't set a value, submitter will be the current user.

Output Values of the Submit for Approval Action

  • Instance ID: This is the Id of the approval request that was submitted.
  • Instance Status: This is the status of the current approval request. Possible values are Approved, Rejected, Removed, or Pending.
  • New Work Item IDs: This output value stores the Ids of the new items submitted to the approval request. There can be 0 or 1 approval processes.
  • Next Approver IDs: This output value stores the Ids of the users who are assigned as the next approvers.
  • Record ID: This is the Id of the record that the flow submitted for approval.

Record-Triggered Flow Example

Let's assume that we want to get an approval when an opportunity's stage becomes 'Needs Analysis' and the amount is greater than 10K.

Create a record-triggered flow on the Opportunity object and set the entry conditions like this. Since you will use the Submit for Approval action, your flow must run after-save. Therefore, you have to choose Actions and Related Records.

Record-Triggered Flow to Submit for Approval

Add an action element and choose Submit for Approval. Then, set values for the action.

Set Input Values

That's all you need to submit the record for approval.

Debug the Flow

Now, let's assume that your approval process allows manually choosing the approver. Create a text collection variable and use an assignment element to add the Id of the approver to this collection.

Assign the Next Approver ID

Then use this text collection variable for Next Approver IDs input value.

Input Values for Submit for Approval Action

At the end, your flow will look like this.

End of the Flow

1 Trackback / Pingback

  1. Using Flow to Send Approval Request to Queue - Salesforce Time

Leave a Reply

Your email address will not be published.


*