Skip to main content

Configure Messaging

Learning Objectives

After completing this unit, you’ll be able to:

  • Write the messages customers receive when a mobile worker is en route.
  • Create a flow to streamline the messaging process.

Create Customer Messages

With Real-Time Location, customers receive two messages: one when the worker is en route to their job site and one when the worker is nearby. Maria has already set up messaging and Digital Engagement in her org so her customers can receive messages via WhatsApp and SMS.

That takes care of what needs to be in place for customers to receive messages. Next, Maria creates the messaging templates to define the contents of the messages that her customers receive.

  1. From Setup Setup gear, in the Quick Find box, enter messaging, and click Messaging Templates.
  2. To create the En Route template, click New.
  3. Name the template.
    1. For Template Name, Maria enters: Enroute Messaging Template
    2. For Developer Name, Maria clicks to fill in Enroute_Messaging_Template
  4. In the Insert Merge Field section, set up the link that takes the customer to the Experience Builder site.
  5. In Related To, select one of the options. Maria chooses Assigned Resource.
  6. In Field, select Appointment Assistant Info URL.
  7. Click Insert. The URL placeholder is added to the message.
    Since Maria selected Assigned Resource in the Related To list, the URL placeholder looks like this: {!AssignedResource.ApptAssistantInfoUrl}
  8. Complete the message that the customer receives.
    Maria enters: Your mobile worker is on the way. Get ready for some sunshine! To see their location on a map, click here: {!AssignedResource.ApptAssistantInfoUrl}
  9. Select one or more channels on which to send the message.
    Maria selects All Channels.
  10. Save your changes.

Maria repeats these steps to create a template for the second message. This one is sent when the mobile worker is 1 mile (1.6 kilometers) away.

  • Template Name: Approaching Job Site
  • Insert Merge Field: same values as before
  • Message: Your mobile worker is 1 mile (or 1.6 kilometers) away. They’ll arrive soon and get to work. To see their location on the map, click here: {!AssignedResource.ApptAssistantInfoUrl}
  • Channels: same values as before

Maria has created the messages that customers see when their mobile workers are on the way. A customer sees the message on their preferred channel, then clicks the URL to view a map and more detailed information on the Experience Builder site.

Create Flows

Now that she has the messages ready to go, Maria sets up flows. Flows streamline the process of sending a customer a message when the Ursa Major mobile worker is en route. First, she defines the information needed to create the flow.

  1. Who triggers the flow? A mobile worker updating a record.
  2. What object triggers the flow? Assigned Resource.
  3. What is the action to take? Send a message.
  4. What is the message? The message defined in the En Route messaging template.

Maria creates and configures the flow.

  1. From Setup Setup gear, in the Quick Find box, enter flows, and then select Flows.
  2. Click New Flow.
  3. Select Record-Triggered Flow and click Next.
  4. Select Freeform to open Flow Builder.
    Flow Builder with a new record-triggered flow
  5. To configure the trigger, click Edit.
    1. In the Trigger the Flow When section, select A record is updated.
    2. In the Run the Flow section, select After the record is saved.
      Configure Trigger dialogue with A record is updated and After the record is saved selected.
    3. Click Done.

Back in Flow Builder, Maria chooses the object that triggers the flow. 

  1. In Object, enter Assigned Resource.
  2. In Condition Requirements, select All Conditions Are Met (AND).
  3. Set the Condition Requirements as follows.
    • Field: LocationStatus
    • Operator: Equals
    • Value: EnRoute
  4. In When to Run the Flow for Updated Records, select Only when a record is updated to meet the condition requirements.
    Choose Object dialogue with the values set
  5. Click Done.

Back in the Flow Builder, Maria sets up the action to perform.

  1. Drag the Action component into the flow.
  2. In the New Action dialog, enter Messaging Notification.
  3. Fill in the fields. Maria uses the following values.
    Field Name Field Description Maria’s values
    Label Label for the action Send En Route Message
    API Name API name for the action. Click to fill in automatically. Send_En_Route_Message
    Description Description of the action Sends a message to a customer telling them that their mobile worker is en route to the job site.
    Messaging Channel Unique Name Name of your channel. When you set up Digital Engagement, Salesforce assigns you this name. Text_US_ and her several digit channel name
    Messaging Template Unique Name Developer name of the Messaging template you created for En Route messages En_Route_Messaging_Template
    Context Record ID The record ID for Assigned Resource (the mobile worker who changed the status)
    1. Enable the toggle.
    2. Enter {!$Record.Id}
    Recipient Phone Number The contact phone number the message is sent to (the customer).
    1. Enable the toggle.
    2. Click to choose from the menu of values.
    3. Choose $Record | Service Appointment | Contact | Mobile Phone.
      The value appears in the field as
      {!$Record.ServiceAppointment.Contact.MobilePhone}
    Recipient Record ID The record ID for the contact (customer)
    1. Enable the toggle.
    2. Click to choose from the menu of values.
    3. Choose $Record | Service Appointment | Contact | ID.
      The value appears in the field as {!$Record.ServiceAppointment.Contact.Id}

    New Action dialog with the values filled in
  4. Click Done.

In Flow Builder, connect the Record-Triggered Flow element to the Action element.

  1. Click the circle at the bottom of the Record-Triggered Flow element and drag the line to the circle at the bottom of the Action element.
  2. Save your flow.

Maria’s first flow is all done. Hooray!

Next, she creates a second flow to send a message to customers that the mobile worker is 1 mile (1.6 kilometers) away. To create the Approaching Messages flow, Maria repeats these steps with a few changes.

She names the new flow Approaching Messages. When she chooses the object that triggers the flow (Assigned Resource), she enters the following values.

  • Condition Requirements: All Conditions Are Met
  • Field: Location Status
  • Operator: equals
  • Value: LastMile

Then, when she sets up the Action, she uses the following different field values:

  • Messaging Template Unique Name: Maria enters the developer name of the Messaging template that she created for Approaching Messages.
  • Messaging Channel Unique Name: Maria enters the developer name of the Approaching Messaging channel.

Now Maria has two flows, one for each message that is sent to customers.

In this unit, Maria set up the message template with messages to send to customers. Then she created a flow to streamline the process. Her work is done! Real-Time Location is set up and ready to start delighting Ursa Major’s customers.

Resources

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