One of the powers of Data Cloud is the way that it can unlock ‘trapped’ data. Let’s say that you had a large set of data like VIN (Vehicle Identification Number) numbers that you did not want to put in your Sales Cloud because of row storage limits, but you really wanted to use that data as part of a new Agent you were building in Agentforce. This is an example of where Data Cloud will give you a place to store those VIN numbers and make it very easy to query and leverage that VIN data through an Action tied to your Agent.
The amazing part of this is that this can all be done now with ‘No Code’. We will leverage Flows in Sales Cloud and the ability of an Action in Agentforce to use that Data Cloud data retrieved through a Flow.
First a couple of demo screens from my Agent…
- I want to ask my Agent for details about a specific VIN like Description, Make, Model and Year. That data is stored in Data Cloud. So I ‘prompt’ my Agent with this sentence: ‘Can you get me the details for a VIN?’
- My agent recognizes what I am asking for and gives me some properly formatted responses so I can ask for the details about my VIN number.
- So now I type in my response with my VIN as it suggested.
- Wow! I got back the details about my VIN number that are stored in Data Cloud. These details included a Description, Make, Model and Year.
Now, how did Agentforce do that?
It is really pretty amazing how much of the above demo is simply Agentforce doing ‘what it does’. My extra part is adding a new Action to extend my Agent from Data Cloud.
So let’s go through those pieces…
- We first need to get the data into Data Cloud into a ‘Data Model Object’. It cannot just get to a ‘Data Lake Object’ (DLO), but has to also be mapped onto a ‘Data Model Object’ (DMO). The ‘GetRecords’ in the Flow that we will use later cannot query a DLO, but only a DMO. This will involve creating a Data Lake Object, a Data Model Object and the associated Data Stream for pulling the VIN data in.
- Here is one way to move data into Data Cloud from Sales Cloud using ‘No Code’, but with our use case above we would probably be using a noETL option to load such a large dataset into Data Cloud from something like Snowflake or Databricks.
- Here is my DMO and the associated VIN data being shown in the ‘Data Explorer’.
- Now the data is loaded in Data Cloud and is ready to be used.
- We need to create a new Action with proper Instructions that is tied to our Flow that will get the data from Data Cloud.
- Create a new ‘Start from Scratch’, ‘Autolaunched Flow (No Trigger)’.
- We can build a Flow as simple as this to make the data available for our Agent.
- The GetRecords can query our Data Cloud DMO that we created above by configuring it like so…
- But where did that ‘VIN_Number’ variable come from? We do need to create a variable in the Flow that is needed for ‘Input’ like this with the ‘Available for input’ being checked…
- We will tie that Input variable to out Action later.
- Now we will do a ‘Decision’ to make sure our ‘GetRecords’ actual found something…
- Now I need to create some ‘Output’ variables to return this data back to my Action. Make sure the ‘Available for Output’ checkbox gets selected for each variable.
- Finally in an ‘Assignment’ set all of these Output variables…
- I did try to work out some formatting issues as I was working through this. My ‘Year’ kept coming back as 2,019 with a comma in it since it was a number. So one solution I did was to create a formula in the flow to convert it to being text. That seemed to work fine…
- I also tried originally to have my Output variable be a custom object in Sales Cloud so that I did not have so many output variables. That did not work well because when Agentforce was trying to show the output of an Object like that it needed a Salesforce ID to display it. So I just went back to individual variables which worked well.
- Go ahead and Save and Activate your Flow.
- Now we need to tie this Flow to an Action in Agentforce.
- In Setup go to ‘Agent Actions’ and choose ‘New Agent Action’.
- Choose ‘Flow’ for the ‘Reference Action Type’
- Choose your ‘Reference Action’ which is the new Flow you just created.
- Give it an understandable ‘Agent Action Label’ and ‘Agent Action API Name’
- Click on ‘Next’
- Now the ‘Input’ and ‘Output’ variables from our Flow come into play. We need to configure our new ‘Agent Action’ with Instructions at the ‘Action’ level and also Instructions for each ‘Input’ and ‘Output’ item. It can look like this…
- Make sure you select ‘Require Input’ and ‘Collect data from user’ for the Input Variable.
- Make sure you select ‘Show in conversation’ for the Output variable.
- Click on Finish
- Now we need to add our new Action to the Agent.
- In Setup go to ‘Agents’
- In the drop-down at the end of the row for your ‘Agent Name’ click on ‘Open in Builder’
- Deactivate your Agent with the button in the top right corner.
- Then click on ‘New’, ‘New Topic’ under the Topic Details section because we have to add a new Topic.
- Fill out the ‘Create a Topic’ page…
- Click on Next
- Select your Flow and click on Finish
- Now we need to add the new Topic to the Agent. Again make sure your Agent is de-activated.
- On the ‘Topic Details’ tab click on the ‘New’ drop-down and select ‘Add from Asset Library’
- Select the Topic you just created and click on ‘Finish’
- Do some testing in ‘Agent Builder’ to make sure your Agent is doing what you want it to do.
- Activate your Agent.
All of that above was ‘No Code’!
While all of that above was a good number of steps, there really is not a ton of work and there was ‘No Code’. Agent Builder and building Actions and Topics is new, but it really is pretty simple configuration. I think the hardest part will be learning how to write really great ‘Instructions’ for these new Topics and Actions so they are leveraged appropriately when the Agent runs. The skill set related to being a ‘Prompt Engineer’ is become more important every day.
Leveraging Data Cloud data is not required for your first Agentforce implementation. Data Cloud has to exist but you would not have to be pulling data out of Data Cloud on day 1. The above solution could be just as well implemented by making an API call through Apex exposing the same VIN data.
Hopefully the above shows you that Salesforce has put together the pieces to make this easy for you to do.
If you are brainstorming about use cases for Agentforce, please read on with this blog post from my colleague Darshan Kukde!
If you want a demo of this in action or want to go deeper please reach out and connect!
Source: Read MoreÂ