Skip to main content
Join the Agentforce Hackathon on Nov. 18-19 to compete for a $20,000 Grand Prize. Sign up now. Terms apply.

Set Up Visit Recommendations Using Flows

Learning Objectives

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

  • Enable Einstein Visit Recommendations.
  • Explain rules-based Einstein Visit Recommendations.
  • Set up rules-based Einstein visit recommendations by using flows.

Enable Einstein Visit Recommendations

Fatima must set up visit recommendations so Gustavo can access them on the AI Visit Recommendations page in the Consumer Goods org. To set up visit recommendations for Gustavo and his field reps, Fatima first needs to enable Einstein Visit Recommendations. Let’s see how she does it.

  1. From Setup, in the Quick Find box, enter Einstein Visit Recommendations, and select Einstein Visit Recommendations.
  2. Enable Status.
  3. In the dropdown list Delete expired visit recommendation after, select the number of weeks after which recommendations in the Recommended status are automatically deleted. Never is selected by default, and Fatima goes ahead with this choice.

The Einstein Visit Recommendations page in Setup showing Einstein Visit Recommendations enabled

With visit recommendations enabled, Fatima has the option to set up either rules-based recommendations or AI model-based Einstein Discovery recommendations. Let’s follow along as she sets up rules-based visit recommendations.

Set Up Rules-Based Einstein Visit Recommendations Using Flows

Rules-based recommendations allow you to set up recommendations based on specific business priorities. Such recommendations are ideal for Gustavo because he has extensive experience with the territory he manages and is familiar with local business priorities. Since Gustavo’s field reps are always tight on the schedule, Fatima must set up rules-based recommendations that help field reps to:

  • Focus on the right stores to visit on a given day.
  • Complete the maximum number of visits possible.

Depending on business priority, visit recommendations can be based on a combination of several rules such as:

  • Prioritizing a store that hasn’t been visited in the last 21 days
  • Prioritizing a store that belongs to Tier A over Tier D
  • Prioritizing a store one week before the promotion start date
  • Prioritizing a store that’s been running short of stock for the last five visits

Fatima can create rules-based recommendations using a flow strategy, a Next Best Action (NBA) strategy, or Apex. We’ll cover NBA strategy and Apex in the next unit.

Gustavo and his field reps have requirements that vary with business priority so they can create multiple strategies. When requesting recommendations on the AI Visit Recommendation Requests page, they can select the strategy that caters to their unique requirement.

For any strategy, you need a flow. Fatima creates a per transaction limit for visit recommendations, which is required for flows. For information on per transaction limits, see Per Transaction Limits for Visit Recommendations

She must now create a flow for the flow strategy. A flow strategy only needs an active flow to work. To set up effective recommendations, Fatima needs information about visit dates and the stores to visit. After getting this information from Gustavo, she creates a flow.

  1. From Setup, in the Quick Find box, enter Flows, and select Flows.
  2. Click New Flow.
  3. Make sure Start from Scratch is selected, and click Next.
  4. Select Autolaunched Flow (No Trigger), and click Create.

The Select Type window showing the options to select the type of flow to create

  1. Select either Freeform or Auto-Layout. Fatima selects Freeform.
  2. Create a flow according to your visit recommendation strategy. To learn how to do that, review the provided Visit Recommendation Sample Flow. For information on how to create a flow, see Build Flows with Flow BuilderA sample visit recommendation flow with eligibility criteria for generating visit recommendations.
  3. Enter the flow’s label and API name. Fatima enters the following information.
    • Flow Label: NTO Store Flow
    • Flow API Name: NTO_Store_Flow
  1. Click Save.
  2. Click Activate.

To add flows as a strategy for visit recommendations, ensure that the names of your input and output variables match one of these strings while creating flows.

  • Input variables
    • SiteIds: Stores the retail stores for which visit recommendations are requested.
    • TargetDate: Stores the date when the visits can be recommended.
  • Output variables
    • RecommendedSiteIds: Stores the retail store for which visits are recommended.
    • VisitRecommendationReasons: Stores the reasons for visit recommendations.

Remember the API name of the flow because you must specify it in the strategy that you create.

Let’s find out how Fatima sets up visit recommendations by using an NBA strategy and an Apex class in the next unit.

Resources

Partagez vos commentaires sur Trailhead dans l'aide Salesforce.

Nous aimerions connaître votre expérience avec Trailhead. Vous pouvez désormais accéder au nouveau formulaire de commentaires à tout moment depuis le site d'aide Salesforce.

En savoir plus Continuer à partager vos commentaires