Flows: Insert the Right Actions at the Right Time (Part 2)

clip art of person checking off items on a checklist

As an admin, there have been times when I really wanted to prompt my users to do a certain task, but only when certain criteria are met. That’s where Actions & Recommendations comes in, a Salesforce hidden gem. In my introductory blog post Actions & Recommendations- Salesforce’s best kept secret , I talked about how the Actions & Recommendations feature can give your users a list of Quick Actions and Flows that you want them to complete for that object (for example, for an Opportunity).

What if you only need your users to complete certain actions, during certain stages, depending on certain criteria?


For example, imagine that your opportunities are for software, of which you sell some perpetual software and some subscription-based software. You only want to prompt them to fill in subscription-related data if it’s a subscription type of Opportunity, at the Negotiation stage. How do you add Actions to the component, but only under certain circumstances?

Enter Flow. Flows can be used to add those actions to the Opportunity, based on whatever criteria you would like to set. How do you say? It turns out that to add an Action to the component, a related record must be added to the Opportunity. This record is for a junction object, something that links the Opportunity to the Action. It’s called a “Record Action.” Let’s see how this would work.

  1. Decide how your Flow will be triggered. This is usually decided by how any automation is currently added to your Opportunity when it hits certain stages- usually by either a Process or a Flow.
  2. Create a Flow that adds Actions to the Opportunity based on Stage, and any other criteria you set. If it’s triggered by other automation (whether a Process or another Flow), it can be an Autolaunched Flow.
  3. In your flow, start with a Get Records element and get the Opportunity that launched the Flow.
  4. Then add a Decision element, and add whatever criteria is needed to add the Action. In this case, I’m using a custom field as a criterion.

  1. To the decision branch that should add the actions, add a Create Records element, and select as your object RecordAction. This is where the magic happens! The possible field values are:
    1. Action Type: Flow or Quick Action (this is the Flow or Quick Action you want to add to the Opportunity)
    2. Action Definition: The API name of the Quick Action or Flow (Note- Quick Actions start with “QuickActionDefinition…”, while Flows just list their API names)
    3. Order: if you want all your Actions to have a numbered order.
    4. Pinned: if there are certain actions you’d like to keep towards the top or bottom of the list, you can enter Top or Bottom here.
    5. RecordId: insert here a reference to the id of the record you are attaching the action too. In this case, the Opportunity ID from the Get Records element.
    6. Status: This is normally New, but you can use Flows to set the status of your actions using this field.
  2. I finish my Flow by using an Update Records element, checking off a custom field on the Opportunity so that I have a record that this set of Actions was added. I then use that field as one of the criteria to decide whether or not to run this Flow. You can also use this element to update any other relevant fields on your Opportunity.

Tips

  1. There’s an easy way to test this out in Production. In your automation, make sure it only adds the RecordActions to a set of test records you’ve created. Then, set the Component Visibility so that it is only visible to admins.
  2. Just getting started with Flow? Get to know the basics on Trailhead! Try the Build Flows with Flow Builder trail. Or, if you prefer watching videos and getting a walk through, Brian Kwong of the Wizard News podcast, has a great Wizard’s Apprentice video series on learning Flow.

in our Third and final installment… Case Study- see a real live example of Actions & Recommendations used to automate the Sales Process coming up. I want to thank Fred for his efforts in sharing his tips on this blog. Feel free to post your comments below or email me at buyan@eigenx.com as well.

Please Subscribe

Subscribe to our mailing list to get tips on maximizing your salesforce

We respect your privacy.

Please subscribe

Subscribe to our mailing list and get tips to maximize salesforce to your email inbox.

I am honored to have your subscription. Stay tuned for tips to maximize your salesforce investment

Something went wrong.

Share:
Fred Tchang

Author: Fred Tchang

I am a Salesforce Administrator, working in a B2B software company serving manufacturers. Working with people to achieve more through technology is what energizes me. I feel lucky to have had a variety of roles, each of which has given me the skills needed to implement change.

Leave a Reply

Your email address will not be published. Required fields are marked *