Loading

Salesforce Flow Approval Processes: How to Dynamically Specify Approvers

Дата публикации: Jun 5, 2026
Описание

In Salesforce Flow approval processes, use a background step and an autolaunched flow to dynamically get an approver's username. Note: Support cannot assist with custom steps.

Решение

Step 1: Create an Autolaunched Flow to Retrieve the Username

Use the Get Records element to retrieve the desired approver's username. This example retrieves the submitter's manager.

  1. From Setup, enter "Flows" in the Quick Find box, and select Flows.

  2. Click New Flow.

  3. Select Autolaunched Automations and click Autolaunched Flow (No Trigger).

  4. Click + under the Start element, select Get Records, and configure the following:

    • Label: Get Username

    • API Name: Get_Username

    • Object: User

  5. Filter User Records:

    • Field: Id

    • Operator: Equals

  6. Click the Value field, select + New Resource, configure the following, and click Done:

    • Resource Type: Variable

    • API Name: submitter

    • Data Type: Text

    • Available for input: Check the box

  7. In the same Get Records element, configure the following:

    • How Many Records to Store: Only the first record

    • How to Store Record Data: Choose fields and assign variables (advanced)

    • Where to Store Field Values: In separate variables

    • Field: Username

  8. Click the Variable field, select + New Resource, configure the following, and click Done:

    • Resource Type: Variable

    • API Name: Manager_Username

    • Data Type: Text

    • Available for output: Check the box

  9. Click Save, enter the following, and click Save:

    • Flow Label: Get Username

    • Flow API Name: Get_Username

  10. Click Activate.

Step 2: Create an Autolaunched Flow Approval Process (No Trigger)

  1. From Setup, enter "Flows" in the Quick Find box, and select Flows.

  2. Click New Flow.

  3. Select Autolaunched Automation and click Autolaunched Flow Approval Process (No Trigger).

  4. Click + and select Stage.

  5. Configure the following values:

    • Label: Stage 1

    • API Name: Stage1

    • Condition: When all steps are marked as completed, the stage is marked as completed.

  6. Click + Add Step.

  7. Select Background Step and configure the following:

    • Label: Get Submitter Manager Username

    • API Name: Get_Submitter_Manager_Username

    • When to Start Step: When the stage starts, the step starts.

    • Action: Select the flow created earlier (Get Username).

    • Set Input Values: submitter: {!submitter}

    • User Type: Automated Process User

  8. Click + Add Step.

  9. Select Approval Step and configure the following:

    • Label: (Any value)

    • API Name: (Any value)

    • When to Start Step: When another step is marked as completed, the step starts.

    • Step Name: Select the background step (Get Submitter Manager Username).

    • Action: Select the approval process action.

    • Approver Type: Resource

    • Resource: Click Stage > Background Step > Output > Manager_Username.

    • Record to Approve: {!recordId}

    • When to Complete Step: When the assigned user completes the action, the step is marked as completed.

  10. Click Save, enter a Flow Label and Flow API Name, then click Save.

  11. Click Activate.

Номер статьи базы знаний

005227582

 
Загрузка
Salesforce Help | Article