Appearance
Exercise 10 (Optional): Query Data Cloud Data in a Flow
In this exercise, you’ll create a flow that queries data in Data Cloud and allows you to bring it into a Lightning record page with Flow.
Step 1: Create a flow that queries for Data Cloud data
Create a new flow
In Setup, search for Flow in Quick Find and select Flows.
Click New Flow.
Leave Start from Scratch selected and click Next.
Select Screen Flow and click Create.
Open the Resources panel by clicking the sidebar icon to the left of the Select Elements button.
Using the New Resource button, create one variable defined as follows:
Resource Type API Name Description Data Type Available for input Available for output Variable recordId
The Record Id that is used to query the case details and gather relevant information.
Text ✅ Unchecked
Get the related Case record
Mouse over the circle under the Start element, click +, and select Get Records.
In the right panel, configure the Get Records action as follows:.
Field Value Label Get Case Record API Name Keep default Description Get the case details from the case that triggered the flow. Data Source Salesforce Object Object Case Condition Requirements All Condition is Met (AND) Define the three conditions below:
Field Operator Value Id Equals recordId Under How Many Records to Store, leave the default value Only the first record.
Under How to Store Record Data, leave the default value Automatically store all fields.
Get the the reservations from Data Cloud
Mouse over the circle under the Get Case Records element, click + and select Get Records.
In the right panel, configure the Get Records action as follows:.
Field Value Label Get Data Cloud Reservations API Name Keep default Description Get the reservation data from Data Cloud through the Contacts External Id. Data Source Data Cloud Object Data Space default Object Reservation Condition Requirements All Condition is Met (AND) Define the three conditions below:
Field Operator Value Contact_ID__c Equals Case from Get_Case_Record > Contact > External_Id__c Check_in_Date__c Greater Than or Equal $Flow > Current Date Set the Sort Records conditions as follows:
Field Value Sort Order Ascending Sort By Creation_Date__c Under How Many Records to Store, leave the default value Only the first record.
Under How to Store Record Data, leave the default value Automatically store all fields.
Display the Reservation details and collect Task details
Mouse over the circle under the Get Data Cloud Reservations element, click +, and select Screen.
In the right panel, configure the Screen Properties as follows:
Field Value Label Create Task API Name Keep default Description Display reservation details and create task In the component sidebar, search for Display Text.
Drag the Display Text component into the screen.
In the right panel, configure the Display Text Properties as follows:
Field Value API Name Reservation_Details Set the components value as follows:
textGuest Details Name: {!Get_Case_Record.Contact.FirstName} Lifetime Value: {!Get_Case_Record.Contact.Lifetime_Value__c} Lifetime Reservations: {!Get_Case_Record.Contact.Lifetime_Reservations__c} Reservation Details Check-in Date: {!Get_Data_Cloud_Reservations.Check_in_Date__c} Special Requests: {!Get_Data_Cloud_Reservations.Special_Requests__c} Room Type: {!Get_Data_Cloud_Reservations.Room_Type__c} Reservation Number:{!Get_Data_Cloud_Reservations.Reservation_ID__c} Create Follow-up Task
In the component sidebar, search for Text.
Drag the Text component into the screen.
In the right panel, configure the Text Properties as follows:
Field Value Label Subject API Name Subject Required ✅ Drag the Long Text Area component into the screen.
In the right panel, configure the Long Text Area Properties as follows:
Field Value Label Description API Name Description Required ✅ Click on Done to finish configuring the screen.
Create a follow-up Task
Mouse over the circle under the Display Reservations element, click +, and select Create Records.
In the right panel, configure the Get Records action as follows:.
Field Value Label Create Follow Up Task API Name Keep default Description Create a follow-up task for the user to address the customer upon check-in. How to Set the Record Field Values Manually (default) Create a Record of This Object Task Set the following field values from the case:
Field Value Subject Subject Description Description ActivityDate {!Get_Data_Cloud_Reservations.Check_in_Date__c}
Priority High WhoId {!Get_Case_Record.ContactId}
WhatId {!Get_Case_Record.Id}
Save and activate the flow
Click Save and configure the flow as follows:
Field Value Flow Label Create Reservation Follow-up Flow API Name Keep default Description This Flows helps service agents create a follow up task for their guests who are experiencing issues. Click Save.
Click Activate.
Your flow should look like the following:
Click the back arrow button to leave Flow Builder and go back to Setup.
Step 2: Create a flow quick action
In Setup, Click on the Object Manager Tab.
Select the Case object.
Click on Buttons, Links, and Actions in the sidebar.
Click on New Action.
Configure the action as follows:
Field Value Action Type Flow Flow Create Reservation Follow-up Label Create Follow-up Task Name Leave the Default Value Description Create a Reservation follow-up task from the case record page Click on Save.
Step 3: Add the flow to the Case Record page
In the App Launcher, select the Coral Cloud app, click the Cases tab, and click the Upcoming Reservation Upgrade Request record.
Click the Setup icon and select Edit Page.
Click on the Highlights Panel component.
In the component Properties, click on Add Action.
Add the Create Follow-up Task action.
Click on Done.
Drag it to the top of the action list.
Save the Record page.
Click the back arrow button to leave Lightning App Builder and go back to the Case page.
Step 4: Test the flow
Click on the Create Follow-up Task action.
Complete the flow screen as follows:
Field Value Subject Priority: Check for upgrade at check-in Details Sofia is a high profile customer and we would love to provide her an upgrade if possible. Please check availability and prioritize. Click on Done.
Summary
In this exercise, you used Flow to query CRM and Data Cloud data and bring them both together to create a task.