Skip to main content

Automate the Process

There Once Was a Robot Named Rover, Who Sent a Bunch of Messages Over

Our rover scouts locations on Mars for us, looking for the ideal spot for our Trailhead basecamp. Let’s create a simple way for the rover to tell us what it finds, using an automated process.

  1. In Setup, enter Flows in the Quick Find box, then select Flows.
  2. Click New Flow.
  3. Select Record-Triggered Flow.
  4. Click Create.
  5. In the Objects field, enter communication and select Communication (Communication__c).
  6. Select A record is created.
  7. Select Any Condition Is Met (OR) from the Condition Requirements dropdown.
  8. In the Field lookup, search number and select the Number__c field.
  9. Ensure Operator lists Equals.
  10. In the Value lookup, enter 1.
  11. Click Add Condition.
  12. Add the following:
    • Field: Number__c
    • Operator: Equals
    • Value: 2
  13. Click Add Condition.
  14. Add the following:
    • Field: Number__c
    • Operator: Equals
    • Value: 3
      The Start element's configuration panel corresponding to the preceding steps.
  15. Click Save to save the flow.
  16. Label your new Flow as Mars.
  17. Ensure API Name is Mars.
  18. Click Save. Note: disregard any warnings.

Time to add a decision element.

  1. On the flow canvas, on the Run Immediately path, hover over Add Element  and click Add Element.
  2. Search and select Decision.
  3. Label the new decision element as Mars Messaging.
  4. Ensure New Outcome is selected in the Outcome Order.
    New Outcome highlighted on Decision element screen.
  5. Add Message 1 to the Label and Outcome API Name is Message_1.
  6. Ensure Condition Requirements to Execute Outcome is set to All Conditions Are Met (AND).
  7. Add {!$Record.Number__c} to the resource textbox.
  8. Ensure Operator lists Equals.
  9. In the Value lookup, search 1 and select the 1 (Text) field.
  10. Click the plus icon add outcome icon next to Outcome Order to add another outcome option.
  11. Add the following:
    • Label: Message 2
    • API Name: Message_2
    • Condition Requirements to Execute Outcome: All Conditions Are Met (AND)
    • Resource: {!$Record.Number__c}
    • Operator: Equals
    • Value: 2
  12. In the Outcome Order, click Default Outcome.
  13. Update the Label to Message 3.
  14. Click Close.

Message Setup

Now we’re ready to set up our actions for each message. We start with Message 1.

  1. On the Message 1 path,  hover over Add Element and click Add Element.Add element under Message 1 highlighted.
  2. Search chatter and select Post to Chatter.
  3. Label the new action as Message from Mars 1.
  4. Ensure the API Name is Message_from_Mars_1.
  5. For Message, paste in the following:
    Hey, it’s your friendly rover real estate agent here. Today I'm doing some serious {!$Record.Verb__c} over to an area on lower Mount Sharp, heading {!$Record.Direction__c} from my starting location. Since the dune field is an active sand field, it is this Rover's guess that the terrain is {!$Record.Adjective__c} and therefore unsuitable for the Trailblazer basecamp. You know what they say, “Location, location, location.” I will make my final stop for the day at the super {!$Record.Adjective__c} bedrock at the base of Mount Sharp. Roger, Rover. Rover out. P.S. Tell {!$Record.Proper_Noun__c} I said hi.
  6. For Target Name or ID, enter Life on Mars.
  7. Toggle Target Type to Include.
  8. In the Target Type text box, enter Group.
    Completed Message from Mars 1 Post to Chatter screen.
  9. Leave everything else as is, and click Done.
  10. Click Save.

Next up, Message 2.

  1. On the Message 2 path, hover over Add Element  and click Add Element.
  2. Search chatter and select Post to Chatter.
  3. Add the following:
    • Label: Message from Mars 2
    • API Name: Message_from_Mars_2
    • Message:
      New! Mars fixer on majestic Olympus Mons. Bring your hydrospanner and your imagination and make this home your own. What this charmer lacks in curb appeal it more than makes up for in protecting you from the freezing, never ending dust storms. You'll be happier than a {!$Record.Adjective__c} {!$Record.Noun__c} {!$Record.Verb__c} {!$Record.Direction__c}. Drinking water DIY. Serious buyers only. Contact Listing Agent {!$Record.Proper_Noun__c} for details.
    • Target Name or ID: Life on Mars
    • Target Type: Include
    • Target Type text box: Group
  4. Leave everything else as is, and click Done.
  5. Click Save.

And finally, Message 3.

  1. On the Message 3 path, hover over Add Element  and click Add Element.
  2. Search chatter and select Post to Chatter.
  3. Add the following:
    • Label: Message from Mars 3
    • API Name: Message_from_Mars_3
    • Message:
      This planet might be cold, but these deals are hot, hot, hot! Today I was {!$Record.Verb__c} {!$Record.Direction__c} over the hill and found a fabulous new listing for you. It's ideally situated, Schiaparelli Crater-adjacent, with lots of potential. Good natural light and in the best area on Mars. Let's talk soon because {!$Record.Proper_Noun__c} is interested, too. This place is better than a {!$Record.Adjective__c} {!$Record.Noun__c} and is priced to move.
    • Target Name or ID: Life on Mars
    • Target Type: Include
    • Target Type text box: Group
  4. Leave everything else as is, and click Done.
    Screenshot of the completed flow.

If your flow happens to have an End element after each message action, that's okay! Your flow will still function as intended (and will pass the check for this unit). However, if you want to merge the branches so they converge into one End element, follow these steps. (Please note: this is optional and doesn't affect the functionality of the flow.) 

  1. Directly after the Message from Mars 1 element, hover over Add Element  and click Add Element.
  2. Select Connect to element.
  3. Click Select element on the Message 2 path's End element.
  4. Repeat the process to connect the Message from Mars 3 element to the End element now shared by the Message 1 and Message 2 paths.

3, 2, 1… Activate!

Now, it’s time to activate the flow.

  1. Click Save.
  2. Click Activate.
  3. Click the Back in the upper left.
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