Skip to main content

Modify Flows to Use Virtual Territories

Learning Objectives

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

  • Modify flows to use virtual territories.
  • Create actions to enable users to run flows.
  • Test the modified flows.

Show Resources from a Virtual Territory

Matt must customize the flows used to book financial planning appointments such that the flows use the virtual territory. When users or customers select a virtual channel when booking appointments, the flow must skip the Select service territory screen and show service resources from the virtual territory.

Get Salesforce IDs

To customize flows, Matt gets the Salesforce IDs of certain records. 

Matt is hardcoding Salesforce IDs to quickly demonstrate the functionality. It’s recommended that you avoid hardcoding Salesforce IDs. See Why You Should Avoid Hard Coding and Three Alternative Solutions.

Here’s how Matt gets the Salesforce ID of the Virtual Territory for Financial Planners service territory.

  1. Click App Launcher to open the App Launcher, find and select Service Territories.
  2. Click Virtual Territory for Financial Planners.
  3. From the URL, copy the Salesforce ID.
    The Virtual Territory for Financial Planners page with the Salesforce ID highlighted.

Similarly, Matt gets the Salesforce IDs of these records.

  • The Financial Planning work type group
  • The Phone Call engagement channel type
  • The Video Call engagement channel type
Note

Because the Schedule Appointments Using Engagement Channels setting is enabled, Matt is using the Salesforce IDs of the virtual engagement channel types. If the setting isn’t enabled, you can use API names of appointment types.

After capturing the Salesforce IDs of the four records, he’s ready to customize the flow.

Customize Flows

Here’s how Matt customizes and clones the Outbound New Appointment flow template to use the virtual territory. 

  1. Click Setup, then select Setup.
  2. In the Quick Find box, enter Flows, and click Flows.
  3. Click New Flow.
  4. Select Use a Template and click Next.
  5. In the All Templates list, select Outbound New Appointment and click Create.
  6. In the button bar, make sure the Auto-Layout setting is selected.
  7. On the path after the Set Location Stage element, click Add Element. Select the Decision element.
  8. In the Decision panel, enter these details.
    • Label: Virtual Territory Decision
    • API Name: Virtual_Territory_Decision
  9. In the OUTCOME DETAILS section, enter these details.
    • Label: Use Virtual Territory
    • Outcome API Name: Use_Virtual_Territory
    • Condition Requirements to Execute Outcome: Custom Condition Logic is Met
    • Add these conditions.
      • Condition 1
        • Resource: engagementChannelTypeId
        • Operator: Equals
        • Value: enter the Salesforce ID of the Phone Call engagement channel type
      • Condition 2
        • Resource: engagementChannelTypeId
        • Operator: Equals
        • Value: enter the Salesforce ID of the Video Call engagement channel type
      • Condition 3
        • Resource: workTypeGroupId
        • Operator: Equals
        • Value: enter the Salesforce ID of the Financial Planning work type group
    • Condition Logic: (1 OR 2) AND 3

The Decision panel with conditions and condition logic entered.

Note

If the Schedule Appointments Using Engagement Channels setting isn’t enabled, use the appointment type field and API names of appointment types in the condition logic.

  1. On the Use Virtual Territory path, click Add Element. Select the Assignment element.
  2. In the Assignment panel, enter these details.
    • Label: Set Virtual Territory ID
    • API Name: Set_Virtual_Territory_ID
    • In the Set Variable Values section, add these details.
      • Variable: select ServiceAppointment then select Id
      • Operator: Equals
      • Value: enter the Salesforce ID of the virtual territory

The Assignment panel with the variable and its value entered.

  1. Click the Location Screen element, then click Cut Element.
  2. On the Default Outcome path, hover over Add Element and click Paste element. The Location Screen element should move to the Default Outcome path.

The flow canvas elements corresponding to the preceding steps.

  1. Click Save As New Flow.
  2. In the Save as, enter these details:
    • Flow Label: Outbound New Appointment_With Virtual Territories
    • Flow API Name: Outbound_New_Appointment_With_Virtual_Territories
  3. Click Save.
  4. Click Activate.

Add the Flow to the Person Account Page

To enable users to run the flow, Matt creates an action and then adds it to the person account page layout.

Here’s how Matt creates the action.

  1. Click Setup, then select Setup.
  2. Click Object Manager.
  3. Click Account.
  4. Click Buttons, Links, and Actions.
  5. Click New Action.
  6. On the New Action page, provide the following details:
    • Action Type: Flow
    • Flow: Outbound New Appointment_With Virtual Territories
    • Standard Label Type: None
    • Label: Schedule Appointment_IncludingVT
    • Name: Schedule_Appointment_IncludingVT
  1. Click Save.

Here’s how he adds the action to the person account page.

  1. Click Setup, then select Setup.
  2. Click Object Manager.
  3. Click Person Account.
  4. Click Page Layouts.
  5. Click Person Account Layout.
  6. In the palette, select Mobile & Lightning Actions. If you see a link to override the predefined actions in the Salesforce Mobile and Lightning Experience Actions section of the layout editor, click the link.
  7. Drag Schedule Appointment_IncludingVT to Salesforce Mobile and Lightning Experience Actions.
  8. Click Save.

Test the Flow

Matt created a flow that uses virtual territories and added an action that enables users to launch the flow. He demonstrates the functionality to Marianna.

  1. Click App Launcher to open the App Launcher, find and select Accounts.
  2. Open the All Person Accounts list view.
  3. Click an account.
  4. Click Schedule Appointment_IncludingVT.
  5. Select By work type group, appointment type, or service territory.
  6. Select Financial Planning.
  7. Select In Person and click Next.
    Observe that Salesforce Scheduler shows the Select service territory screen.
  8. Click Previous.
  9. Select Video Call or Phone Call, then click Next.
    Observe that Salesforce Scheduler skips the Select Service Territory screen and directly shows the Select Service Resource screen.

Matt has successfully tested the flow that’s used for outbound appointments.

You must customize each flow that you want to use for virtual territories. Matt customizes the remaining flows, replaces existing flows with customized flows, and then meets Marianna to inform her about the changes. She’s amazed by his speed! She thanks him and asks if he needs anything or has any suggestions.

Improve Efficiency Using Appointment Distribution

Matt informs Marianna that the number of financial planners assigned to the virtual territory is 16. And that number is growing fast. He adds that checking calendars of more than 20 qualified service resources can slow down Salesforce Scheduler. Especially when it’s also checking external calendars.

So he proposes implementing appointment distribution. It allocates appointments quickly and evenly among service resources. It also improves speed by considering only the 20 least utilized resources at any given time. For more information, see Salesforce Scheduler Implementation Guidelines and Appointment Distribution with Salesforce Scheduler.

After discussing the nuances of how it works, Marianna agrees that it can add immense value due to how fast their teams are growing. She thanks Matt for being proactive and asks him to implement appointment distribution.

Virtual Territories Are Live

In this unit, Matt customized flows such that virtual appointments are assigned to bankers in virtual territories and in-person appointments are assigned to bankers working from branches.

Stay tuned! In the next unit, follow along as Matt configures a video conferencing software to make handling video appointments easier.

Resources 

Condividi il tuo feedback su Trailhead dalla Guida di Salesforce.

Conoscere la tua esperienza su Trailhead è importante per noi. Ora puoi accedere al modulo per l'invio di feedback in qualsiasi momento dal sito della Guida di Salesforce.

Scopri di più Continua a condividere il tuo feedback