HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
Einstein Next Best Action (NBA)
1. Salesforce Apex Hours
Einstein Next Best Action
The Other NBA
#SalesforceApexHours
Speaker :- Daniel Peter(Salesforce MVP), Amit Chaudhary
Date :- Saturday, FEB 16, 2019 10:00 AM EST (8:30 PM IST)
Venue/Link :- https://zoom.us/j/847916414
2. Who am I ?
Amit Chaudhary
• Active on Salesforce Developer Community
• Blogging at http://amitsalesforce.blogspot.in/
• Co-Organizer of :- FarmingtonHillsSFDCDug
• Salesforce MVP
3. Our Speaker
Daniel Peter
• 2x Salesforce MVP
• 25x Salesforce Certified
• Salesforce Practice Lead, Robots & Pencils
• Bay Area Salesforce Dev Group
• @danieljpeter
4. Einstein Next Best Action is not AI.
But it is still incredible.
And you will see how easily you can customize it to
power it with any AI of your choice.
5. Terminology
Strategy Builder
UI for managing the overall loading, filter and branching logic of the recommendations.
Recommendations
A new standard object in Salesforce. Text, an image, custom fields.
Action strategies
Determine which recommendations you show. You build these with Strategy Builder.
Screen flow
Built with lightning flow builder, this is how you execute the recommendation.
7. Tips
1 strategy per object
5,000 Next Best Action strategy requests per month at no charge.
Image size for recommendations
1000 x 380 recommended by salesforce
1000 x 450 seemed to look better on desktop to me
8. Tips
Writing formulas in strategy builder.
No formula editor! (yet?)
Write the formula in a “scratch” formula field, copy and paste into strategy builder.
11. It’s called Einstein. How do you get the AI?
It’s all about the custom Action Strategies!
1) Create a connection to invocable Apex in Strategy Builder. Call any prediction
service.
2) Run predictions on any fields on the object, write the predicted values, and
reference these values in your filter expression in Strategy Builder. Batch Apex,
Aysnc Apex, Prediction Builder!
3) Combination of human intelligence (rules) + AI if you want
12. Issues
Dynamic screen flows launched from recommendations
Can’t seem to get the recommendation Id of the recommendation launching the
flow. Can only get the parent record such as Case Id. This means you would have
to make different screen flows for different recommendations if you wanted them to
do custom things for each recommendation.
Hopefully someone will solve this (Salesforce?)
13. Packaging / Metadata / Backend
https://developer.salesforce.com/docs/metadata-coverage
Custom fields on Recommendation object not available for managed package. Can retrieve /
deploy, data load.
Strategies not available for managed package
https://developer.salesforce.com/docs/atlas.en-
us.api_meta.meta/api_meta/meta_recommendationstrategy.htm
Can query via tooling API: SELECT Id, fullName FROM RecommendationStrategy
Flows are packageable
Chatter API: https://developer.salesforce.com/docs/atlas.en-
us.chatterapi.meta/chatterapi/connect_resources_nba_resources.htm
14. Docs
Einstein Next Best Action Docs
https://help.salesforce.com/articleView?id=einstein_next_best_action.htm
Strategy Builder
https://help.salesforce.com/articleView?id=nba_strategy_builder_tour.htm&type=5
NBA expressions
https://help.salesforce.com/articleView?id=nba_strategy_expressions.htm
https://help.salesforce.com/articleView?id=customize_functions.htm&type=5