Appearance
Exercise 9 (Optional): Extend Agents with Data Cloud
In this exercise, you’ll extend your Customer Service Agent with a Data Cloud–powered Flow action to retrieve a guest’s latest reservation.
Step 1: Query Data Cloud from Flow
In Setup, search for Flows and select Flows.
Open the Get Data Cloud Reservations flow.
Under the Get Contact element, click + and select Get Records.
Configure the Get Records element as follows:
Field Value Label Get Reservations
API Name Keep default Data Source Data Cloud Object Data Space default
Object Reservation Condition Requirements All Conditions Are Met (AND) Define the condition:
Field Operator Value Contact_ID__c Equals {!Get_Contact.External_Id__c}
Set Sort Order to Descending and Sort By to Check_in_Date__c.
Leave How Many Records to Store and How to Store Record Data at their defaults.
Open the Toolbox, select the latestReservation Text Template, and replace the placeholder with:
txtNext Reservation Check-in Date: {!Get_Reservations.Check_in_Date__c} Check-out Date: {!Get_Reservations.Check_out_Date__c} Reservation Status: {!Get_Reservations.Reservation_Status__c} Special Requests: {!Get_Reservations.Special_Requests__c}
TIP
The Text Template can output rich text, so feel free to style this in the way that you would want to present it to users in the agent.
Click Done, then Save, and Activate the flow.
Click the back arrow to return to Setup.
Step 2: Create a new Agent Action
In Setup, search for Agentforce Agents and select Agents.
Click on Customer Service Agent, then Open in Builder.
Click Deactivate to deactivate the agent.
In the Topics sidebar, select the Hotel Customer Service topic.
Under This Topic’s Actions, click New → Add from Asset Library → Create New Action.
Configure the action:
Field Value Reference Action Type Flow Reference Action Get Data Cloud Reservations Agent Action Label Keep default Agent Action API Name Keep default Loading Text Getting latest reservation...
Require Input contactId (check the box) Output Rendering Rich Text (show in conversation) Click Finish, then Save, and Activate the agent.
Step 3: Test the New Action
In the Conversation Preview, enter:
txtCan you provide an overview of the guest Sofia Rodriguez?
Next, enter:
txtDoes Sofia have any upcoming reservations?
Observe that the plan selects Identify Record by Name then Get Data Cloud Reservations.
Summary
- Updated the Flow to retrieve and format the latest reservation from Data Cloud.
- Created and added a Flow-based custom action in Agentforce.
- Reactivated the Hotel Customer Service topic with this new action.
- Validated end-to-end functionality in the Conversation Preview.