The online Trailblazer Community becomes read-only Oct 30, 2026. Read More
Enhance your users’ experience by embedding personalized decisions directly within Salesforce Flows using the Get Personalization Decisions invocable action. This action uses the Personalization Decisioning API to retrieve tailored suggestions based on contact information. By configuring the input parameters and using the provided Apex classes, you can show relevant content and product recommendations within your record pages, agent consoles, and other Flow-driven processes.
This example describes how to use the Get Personalization Decisions invocable action to configure a flow that retrieves and displays personalization content for a contact record.
Before you begin, make sure you have:
To map values from your contact record and personalization point to the Get Personalization Decisions action and then show the result to a screen, add the default Apex classes to your Flow.
Open the Toolbox and click New Resource.
From the Resource Type dropdown, select Variable.
Provide an API Name. For example, persnlDecInpRep.
From the Data Type dropdown, select Apex-Defined.
Leave Allow multiple values (collection) unchecked.
Search for and select the Apex class ConnectApi__PersnlDecisionInputRepresentation.
Check Available for input and then click Done.

Repeat the preceding steps to create these resources.
| Apex Class | Example API Name | Purpose |
|---|---|---|
ConnectApi__PersnlDecisionOutputRepresentation | persnlDecOutRep | To reference personalized data, recommendations, and diagnostics information when displaying the output to a Contact record. |
ConnectApi__PersnlPointInputRepresentation | pesrnlPointVariable | Variable for personalization point names. |
To pass the Contact’s ID through the Flow a variable is needed to store it.
recordId.Assign the ID from the Contact to the variable. This variable will be used to find the Unified Individual in Data Cloud.
{!$Flow.CurrentRecord}.{!recordId.Id}.For more information on adding record context to your flows, see Add Record Context to Your Flows. For considerations to keep in mind before using flow actions, see Flow Action Considerations.
For your flow to correctly identify and reference the specific personalization point you’ve configured, you’ll need to add personalization point resources.
PersnlPoint_ApiName_Action_Input.The personalization point type determines the output format. Use a Recommendations type personalization point to retrieve product recommendations, or a Manual Content type personalization point to retrieve content attributes.
Note
Get Unified Individual for Contact Record.Unified Individual.ssot__FirstName__c.{!recordId.FirstName}.ssot__LastName__c.{!recordId.LastName}.Get Unified Link Individual.Unified Link Individual.UnifiedRecordId__c{!Get_Unified_Individual.ssot__Id__c}.Follow these steps to map the individualID you retrieved from Data Cloud and the personalization point from the input screen to ConnectApi__persnlDecisionInputRepresentation.
Personalization Point and Individual ID Assignment.| Assignment | Operator | Example Assignment |
|---|---|---|
Assign the Apex-defined variable for personalization point name (the one associated to the Apex Class ConnectApi__PersnlPointInputRepresentation) to the personalization point resource | Equals | {!pesrnlPointVariable.persnlPointName} Equals {!PersnlPoint_ApiName_Action_Input} |
Assign the list of personalization points from the Apex-defined variable for ConnectApi__PersnlDecisionInputRepresentation to the variable for personalization point names | Add | {!persnlDecInpRep.personalizationPoints} Add {!pesrnlPointVariable} |
Assign context.individualId from the Apex-defined variable for ConnectApi__PersnlDecisionInputRepresentation to the unified individual ID retrieved by the second Get Records element | Equals | {!persnlDecInpRep.context.individualId} Equals {!Get_Unified_Individual.ssot__Id__c} |
Next, pass in the variable you created in the previous step into the Get Personalization Decisions invocable action.
ConnectApi__PersnlDecisionInputRepresentation Apex class.FLOW.ConnectApi__PersnlDecisionOutputRepresentation Apex class.To process the personalization decisions retrieved by the Get Personalization Decisions invocable action, add two Loops to the flow. The first loop iterates through the persnlDecisionOutputRepresentation.personalizations collection. The second loop iterates through a collection within each personalization object, depending on your personalization point type.
Loop1.{!persnlDecisionOutputRepresentation.personalizations to loop through the collection.{!Loop1.persnlRecommendations} to iterate through product recommendations.{!Loop1.contentAttributes} to iterate through content attributes.In this step, you’ll add a Screen element to show the personalization decisions to your users on the Contact page.
Add a Screen element after the second Loop and label it.
Add a Repeater component to the canvas and provide an API Name.
Drag a Display Text component within the Repeater component and provide an API Name.
Use the Insert a resource… field to search for and insert resources to show your results as shown in the examples below.
These examples use resource names and values referenced in this article.
Note
1Personalization Point Name: {!Loop1.persnlPointName}
2
3Personalization Point Attributes: {!Loop1.attributes}
4
5Unified Individual: {!Get_Unified_Individual.ssot__Id__c}
6
7Individual ID: {!Get_Link_Individual.SourceRecordId__c}
8
9Name: {!Get_Unified_Individual.ssot__FirstName__c} {!Get_Unified_Individual.ssot__LastName__c}
10
11Request ID: {!persnlDecOutRep.requestId}
12
13Recommendations: {!Loop1.persnlRecommendations}
14
15Recommendations from persnlRecommendations Collection: {!Loop2.additionalProperties}
16
17Diagnostics: {!persnlDecOutRep.diagnostics}1Personalization Point Name: {!Loop1.persnlPointName}
2
3Personalization Point Attributes: {!Loop1.attributes}
4
5Unified Individual: {!Get_Unified_Individual.ssot__Id__c}
6
7Individual ID: {!Get_Link_Individual.SourceRecordId__c}
8
9Name: {!Get_Unified_Individual.ssot__FirstName__c} {!Get_Unified_Individual.ssot__LastName__c}
10
11Request ID: {!persnlDecOutRep.requestId}
12
13Attributes: {!Loop1.contentAttributes}
14
15Attribute Name from contentAttributes Collection: {!Loop2.attributeName}
16Attribute Value from contentAttributes Collection: {!Loop2.attributeValue}
17Diagnostics: {!persnlDecOutRep.diagnostics}Finally, to add personalization decisions to your Contact page, edit the page by following these instructions.
A fully configured flow that retrieves and displays personalized recommendations for a contact record looks like this.
