Tips and Tricks for Generating Recommendations from Accounts and Other SObjects

Suppose you want to recommend Accounts using Einstein NBA. You can build a list of Accounts and filter it, and then map the accounts to the recommendation format that the NBA Recommendation component understands. Users can then click to Accept or Reject those recommendations. Suppose you then want to generate a report to determine which Account recommendations were most frequently approved. Is this possible?

You can Load regular records (Account, Contact) into Strategy Builder but you must map them to recommendations

Consider the strategy below:

The Inspector shows that two accounts are being output from the strategy. Yet when we point a Next Best Action component at this strategy, we don’t see them:

The problem here is that the NBA component expects to receive data structured as Recommendation objects, not Account objects. So you need to generate corresponding recommendations with the Map element:

Let’s configure Map as follows:

We’re able to save and the Inspector shows two recommendations being output, but still nothing shows up:

To isolate the issue, I’m going to add some ‘plain’ recommendations to the strategy and see if those succesfully come through. You can see here that the strategy is output two recommendations generated from accounts and a bunch of ‘plain’ recommendations

When we look at the page, we see the plain recommendations but not the account-derived recommendations. That tells us something’s wrong with our mapping:

Now, next I’m going to use a useful little trick to further isolate the issue. Note that in the above image, Maximum Recommedations Displayed is set to 4. Watch what happens when I change it to 3:

Before continuing, you might want to take a moment and try to figure out what this tells us….

….well, the fact that only 1 of the plain recommendations shows when Maximum Recommendations Displayed is reduced to 3 suggests strongly that our 2 Account-derived Recommendations are successfully be delivered to the Next Best Action component, but it’s somehow failing to render them properly.

It turns out that the component is pretty finnicky about the fields of data that are provided to it. When you derive recommendations by mapping from SObjects, you really need to make sure all the fields that are required are properly there. (Of course, the right thing to do would be to provide some user-friendly validation, but so far Salesforce hasn’t been able to resource that).

Among the required fields: you MUST have an ActionReference that has as its value the literal name of an activated Screen Flow.

Note how the ActionReference shows up in Map with the label ‘Action’:

Once we have this, our Account-derived recommendations show up:

Note that, counter to usual practice, Description is a required field because it forms the core of the recommendation body. Not providing a Description as part of your Mapping will lead to strange unexpected behavior.

When you generate a report of recommendation reactions, the account-derived recommendations show up among the plain recommendations, and the Account Id is available in the report’s Recommendation Source Id field:

More information on Mapping

NBA Home