Last Updated on April 2, 2022 by Rakesh Gupta
Big Idea or Enduring Question:
How can I use automation to update open opportunities related to an account?
Objectives:
- Use the decision element to check the account’s current status
- Define criteria so specific records receive specific updates
- Use record-triggered flow to update other records related to an account
Business Use case
Steve Cartwright is working as a System Administrator at Universal Containers (UC). He has received a requirement from management, that whenever a customer is going out of business, then auto-update related Open opportunities to Lost.
Automation Champion Approach (I-do):

Guided Practice (We-do):
There are 2 steps to solve Steve’s business requirement using Record-Triggered Flow. We must:
- Create a custom checkbox field (Out of Business on Account)
- Salesforce Flow Steps:
- Define flow properties for record-triggered flow
- Add a Decision element to check the account status
- Add an Update Records element to update the related opportunities
Step 1: Create a Custome Field – Out of Busines
- Click Setup.
- In the User Interface, clicks on Object Manager.
- Navigate to Account | Fields & relationships and click on the New button.
- Click on the Checkbox data type.
- Enter Field Label the Field Name will auto-populate.
- Click on the Unchecked for the Default Value.
- Add a field on the Page Layout and grant field access to the desired profiles.
- Click Save.
Step 2.1: Define Flow Properties
- Click Setup.
- In the Quick Find box, type Flows.
- Select Flows then click on the New Flow.
- Select the Record-Triggered Flow option, click on Create and configure the flow as follows:
- Object: Account
- Trigger the Flow When: A record is created or updated
- Set Entry Criteria
- Condition Requirements: None
- Optimize the Flow For Action and Related Records
- Click Done.
Step 2.2: Using Decision Element to Check, if Account Out of Business Equals True
Now we will use the Decision element to check if the account out of business changed to True.
- On Flow Designer, click on the +icon and select the Decision element.
- Enter a name in the Label field; the API Name will auto-populate.
- Under Outcome Details, enter the Label the API Name will auto-populate.
- Condition Requirements to Execute Outcome: All Conditions Are Met (AND)
- Row 1:
- Resource: {!$Record.Out_of_Business__c}
- Operator: Equals
- Value: {!$GlobalConstant.True}
- Row 1:
- When to Execute Outcome: Only if the record that triggered the flow to run is updated to meet the condition requirements.
- Click Done.

The reason why we would select the Yes checkbox for the question is — Only if the record that triggered the flow to run is updated to meet the condition requirements — is to allow the record-triggered flow to execute the actions only if the record meets the criteria now, but the values that the record had immediately before it was saved didn’t meet criteria. This means that these actions won’t be executed when irrelevant changes are made.
Step 2.3: Add Action – Update Records
The next step is to update the open opportunity status to closed lost. We will use the Update Records element.
- On Flow Designer, below the Yes node, click on the +icon and select the Update Records element.
- Enter a name in the Label field; the API Name will auto-populate.
- For How to Find Records to Update and Set Their Values select Specify conditions to identify records, and set fields individually
- Object: Opportunity
- Select All Conditions Are Met (AND).
- Set Filter Conditions
- Row 1:
- Field: AccountId
- Operator: Equals
- Value: {!$Record.Id}
- Click Add Condition
- Row 2:
- Field: IsClosed
- Operator: Equals
- Value: {!$GlobalConstant.False}
- Row 1:
- Set Field Values for the Opportunity Records
- Row 1:
- Field: StageName
- Value: Closed Lost
- Row 1:
- Click Done.
In the end, Steve’s Flow will look like the following screenshot:
Once everything looks good, perform the steps below:
- Click Save.
- Enter Flow Label the API Name will auto-populate.
- Click Show Advanced.
- API Version for Running the Flow: 54
- Interview Label: Update Open Opportunities to Lost {!$Flow.CurrentDateTime}
- Click Save.
Almost there! Once everything looks good, click the Activate button.
Independent Practice (You-do):
Think about your own sales process. What are the additional actions we could add to this process?
Proof of Concept
Now onwards, if a business user updates an Account Out of business to True, then Record-triggered flow will automatically update related open opportunities to closed lost.
- Currently, there are Two open Opportunities attached to Account Deer Valley Corp as shown in the following screenshot:
- Now we update the Out of Business on Account to Checked.
- Navigate back to the Account and check the status of Opportunity. Record-triggered flow automatically marked those open opportunities as closed lost.
Formative Assessment:
I want to hear from you!
What is one thing you learned from this post? How do you envision applying this new knowledge in the real world? Feel free to share in the comments below.
Hi there – is it better to set a lot of limiting conditions in the Criteria node or just have a lot of Immediate Actions with conditions that further limit the list of records? Thank you!
I would say add lots of Immediate Actions with conditions. Using this you can able to incorporate multiple business requirements in once Process.