Setting up the Flows using Flow Builder for any Object
Steps to Create the Flows: This is an example, Flows are created for an Expense Report object, Users can create flows for any other object based on their business requirements.
Step 1 : Click the gear icon on the top right corner, it will redirect to the Setup page. Then, type ‘Flows’ in the Quick Find Box in the Setup Page.
Step 2 : On the result, Under Process Automation , Click the ‘Flows’ as shown in the below screenshot.
Step 3 : Click the ‘ New Flow ‘ button. Once Clicked, it will redirect to the Flow Builder page.
Step 4 : Select the ‘ Record-Triggered Flow ‘.
Step 5 : Click the ‘Create’ button.
Step 6 : In the Configure Start form, Choose the Object as ‘Expense Report’ under Select Object.
Step 7 : Choose Trigger the Flow when as ‘A record is created or updated’. (This indicates when to trigger the flow by Created/Updated).
Step 8 : Select the Condition Requirements, choosing ‘All Conditions Are Met (AND)’. In the Field Column , choose ‘Id’, Operator Column as ‘Is Null’ and Value Column as ‘False’.
Step 9 : Under Optimize the Flow for, Select ‘Actions and Related Records’ .
Step 10 : Click the ‘Done’ button.
Add the Decision Element:
Once the Configure Start is set successfully. It will come to the Canvas. Here, you can drag the Elements or by clicking ‘ +/ Add Element ‘ to add the Elements.
Click on ‘ + ’ icon to add elements
Step 11 : Click the ‘+ Add Element’ .
Step 12 : Scroll down to Logic, Select the ‘Decision’.
Step 13 : A New Decision form will Open.
Step 14 : Enter the Label name and the API name will get auto populated.
Step 15 : Under the Outcome Details, Name the Label for the Decision and it will automatically apply to the Outcome API Name.
Step 16 : In the Condition Requirements to Execute Outcome , choose the ‘All Conditions Are Met (AND)’.
Step 17 : In the Resource Column, Choose the ‘{!$Record}’ and Select the salestrip__Status__c (Status).
Step 18 : Choose the Operator as ‘Equals’ and Choose the Value as ‘Pending Approval’.
Step 19 : Under When to Execute Outcome, Select ‘If the condition requirements are met’.
Step 20 : If you want to add another Condition, Click the ‘+ Add Condition’, else click on Done button.
Add the New Outcome :
Step 21 : In the Outcome Order, Click the ‘+’ to add the ‘ New Outcome ’.
Reason for adding New Outcome - Evaluate a set of conditions, and route users through the flow based on the outcomes of those conditions.
Step 22 : Enter the Label Name and it will automatically apply to the Outcome API Name.
Step 23 : In the Condition Requirements to Execute Outcome, choose the ‘All Conditions Are Met (AND)’.
Step 24 : In the Resource Column, Choose the ‘ {!$Record}’ and Select the salestrip__Status__c (Status).
Step 25 : Choose the Operator as ‘Equals’ and Choose the Value as ‘Approved’.
Based on the requirements, create the other Outcomes (e.g. Status = Rejected)
Drag the Update Records Element :
This is used to update the Field.
Step 26 : In the left Corner, drag the Update Records Elements to the Canvas.
Step 27 : Enter the Label Name and the API Name will get auto populated.
Step 28 : Under How to Find Records to Update and Set Their Values, Select the ‘Specify conditions to identify records, and set fields individually’.
Step 29 : Choose the Object as ‘Expense’.
Step 30 : In the Condition Requirements to Update Records, choose the ‘All Conditions Are Met (AND)’.
Step 31 : By Filtering, by selecting Field as ‘salestrip__ExpenseReport__c’ , Operator as ‘ Equal ‘ and Value as ‘ Expense_Report__c.Id’.[{!$Record.Id}]'.
Step 32 : Under Set Field Values for the Expense Records, Select Field as salestrip__Status__c [Expense Status ] and Value as ‘Pending Approval’.
Step 33 : Verify the entered values and Click the ‘ Done ‘ button.
Choose the Outcome for Decision connector:
Step 34: Using Connectors to connect the Update Records, based on the Decision Outcome.
Step 35:Choose the appropriate outcome.
Step 36:Click the ‘Done’ button.
Step 37 : In the top right corner, Click ‘Save’.
Step 38 : Enter the name of the Flow label and the Flow API Name will be auto populated.
Step 39 : Click the ‘Save’ button.
Step 40 : Click the ‘ Activate ‘ button to Activate Flow.