Skip to main content

Create an Automation with Flow

Follow Along with Trail Together

Want to follow along with an expert as you work through this step? Take a look at this video, part of the Trail Together series.

(This clip starts at the 59:50 minute mark, in case you want to rewind and watch the beginning of the step again.)

Note

Accessibility

This step requires some additional instructions for screen reader users. To access a detailed screen reader version of this step, click the link below:

Open Trailhead screen reader instructions.

Introduction

Creating a flow—such as automatically changing the value of a field to a value you specify based on certain criteria, as we do here—is another way to prevent data from getting messy. Depending on the type of field, you can apply a specific value, make the value blank, or calculate a value, all based on a criteria you set. Use automation to improve data quality by reducing manual data entry and keeping data in sync.

Set Up Automated Updates

You’ve gotten another task from the AW Computing VP of sales Allison Wheeler. She requested that the Opportunity stage automatically updates to Qualification when all tasks for the Prospecting stage are complete. You can take care of this by creating a flow in Flow Builder. But first there’s a little prep work. Much like you add containers to your pantry to keep items organized, you can add custom fields to objects to keep data organized.

First, add a First Contact Made field to the Opportunity object.

  1. From Setup, click the Object Manager tab.
  2. Click Opportunity, then click Fields & Relationships.
  3. At the top of the Fields & Relationships section, click New.
  4. Select the Checkbox radio button, and click Next.
  5. Complete the new field details in Step 2:
    Field Value
    Field Label First Contact Made
    Default Value unchecked
    Field Name [this field auto-populates]
  6. Click Next, then complete Step 3.
    • In the Read-Only column header, select the checkbox.
    • In the Read-Only column, deselect the Standard User and System Administrator checkboxes.
  7. Click Next, then click Save & New.

Now add an Additional Meeting Scheduled field to the Opportunity object:

  1. Select the Checkbox radio button, and click Next.
  2. Complete the new field details in Step 2:
    Field Value
    Field Label Additional Meeting Scheduled
    Default Value Unchecked
    Field Name [this field auto-populates]
  3. Click Next, then complete Step 3.
    • In the Read-Only column header, select the checkbox.
    • In the Read-Only column, deselect the Standard User and System Administrator checkboxes.
  4. Click Next, then click Save.

Now the sales team can use these newly created fields to keep better track of their opportunity stages, and you can use the fields in a flow.

Start by choosing the type of flow. 

  1. From Setup, click the Home tab.
  2. Enter Flows in the Quick Find box, select Flows, then click New Flow.
  3. Select Record-Triggered Flow and click Create.

Next, choose the opportunity object and the trigger.

  1. In the Select Object section, enter opportunity and select Opportunity.
  2. Choose A record is created or updated in the Configure Trigger section.
  3. In the Set Entry Conditions, select All Conditions Are Met (AND).
  4. Fill in the criteria.
    • Field = StageName
    • Operator = Equals
    • Value = Prospecting
  5. Choose Every time a record is updated and meets the condition requirements in the When to Run the Flow for Updated Records section.
  6. Select Fast Field Updates in the Optimize the Flow section.

Now add an action to the flow you’re creating to ensure the Opportunity stage is only updated to Qualification when both First Contact Made and Additional Meeting scheduled are both checked.

  1. On the flow canvas, on the path after the Start element, hover over Add Element  and click Add Element.
  2. Choose Update Records.
  3. Enter Label Opportunity Stage Update.
  4. Click in the API Name text box to generate an automated API name.
  5. Select Use the Opportunity record that triggered the flow.
  6. In the Set Filter Conditions section, select All Conditions Are Met (AND).
  7. Click + Add Condition and fill in the criteria.
    • Field 1 = First_Contact_Made__c
    • Operator 1 = Equals
    • Value 1 = {!$GlobalConstant.True}
    • Field 2 = Additional_Meeting_Scheduled__c
    • Operator 2 = Equals
    • Value 2 = {!$GlobalConstant.True}
  8. Under Set Field Values for the Opportunity Record, fill in the criteria.
    Field Value
    StageName Qualification

Save and activate the flow.

  1. Click Save.
  2. For Flow Label, enter Opportunity Stage to Qualification.
  3. Click in the API Name text box to generate an automated API name.
  4. In Description, enter: Update the opportunity stage to Qualification when all tasks for the Prospecting stage are complete.
  5. Click Save.
  6. Click Activate.

Test the Flow

  1. Click the back arrow back arrow to return to setup.
  2. Click the App Launcher App Launcher icon and select Sales.
  3. Click the Opportunities tab.
  4. Click the down arrow next to Recently Viewed opportunities, then select All Opportunities from the list view.
  5. Open the Pyramid Emergency Generators opportunity.
  6. Click Details to view the associated fields to this record.
  7. Note that the current stage is Prospecting.
  8. Click the pencil icon next to First Contact Made field.
  9. Add checks to First Contact Made and Additional Meeting Scheduled.
  10. Click Save.
  11. Note that the current stage is now Qualification. The flow worked as anticipated!

Put away your virtual broom and data dustpan, and peel off those rubber gloves—you’re done with the dirty work! Using validation rules, formula fields, lookup filters, and a flow to enforce data quality, you’re preventing the buildup of schmutz, and AW Computing is on its way to an org full of simply sparkling data.

Keep learning for
free!
Sign up for an account to continue.
What’s in it for you?
  • Get personalized recommendations for your career goals
  • Practice your skills with hands-on challenges and quizzes
  • Track and share your progress with employers
  • Connect to mentorship and career opportunities