Hey there savvy sailors! We are once again diving into Einstein AI Copilot and the Salesforce Einstein Flex Prompt Builder.
I went through the process of setting up your first field generation prompt type in my last post on Einstein Copilot Prompt builder so I suggest taking a look at that post first.
Some Quick Fixes for the Prompt Builder
First there were some changes that I found from using the prompt builder a few more times since my last post. It looks like you can enter the merge field of the resource you want to use directly into the prompt template workspace by typing it into the workspace. But you need to use special symbols around the resource to indicate it is a merge field.
Example : “{!$Case__c.Name}”
The brackets, exclamation point and dollar sign wrapped around the resource field or name will automatically resolve once entered in the prompt builder.
Also a new thing that I found is that you can use Visual Flows as a resource in your prompt builder. I will walk through the Flex Prompt Template type and adding a flow in the prompt builder in this post.
The Flex Prompt Builder Template
You can find the flex prompt template builder in the setup menu under “Prompt Builder”. This prompt template is meant to be used in business cases where you need to pull in information from many sources and provide on demand values. It can be used in a variety of instances outside of the fields and records. Some use cases for the flex prompt builder are the following:
- Creating a prompt for a text message response,
- Creating a flow
- Creating a newsletter
- Creating a script for your sales or customer agents
The example I used for this flex prompt is to generate a customer response to a case via text message.
For the flex prompt you need to first define the resources you will be using. In this case I have the Case and the Account objects which I label as “Customer Case” and “Customer Account”.
Once you click next, you are taken to the prompt builder workspace and you can select resources. Then you can select your Generative AI model and enter in the prompt template for your flex template. This is the same setup as mentioned in the post covering the Field Generation Prompt Builder.
Some Differences in the Prompt Builders
The difference with the Flex Prompt builder from the other prompt builder types, is that you should be more specific about what the prompt is being used for so that the generative AI can provide the right context and response. By making it clear through the prompt details and giving detailed prompts this will help generate better responses.
In this example, I gave clear instructions for the Generative AI to follow and stated exactly what type of response that the Generative AI model should be sending back as a response which was a text message.
Like with the field generation prompt, you can enter in records as preview data to test out the response from the Generative AI model chosen. In this instance, I selected a Case and related Account from my Salesforce org. Also I set the Resolution as Enabled, which lets you see how Einstein AI is pulling the data from Salesforce. Below is the response that came back using the preview. You can modify your prompt builder as necessary and re-run the preview until you are satisfied with what is generated.
Flows in Salesforce Einstein Copilot Prompt Builder
I found that using a flow in the prompt builder really extends the values that can be in the response. You can select the Resource field in the workspace and then select Flows to see all the available flows for the prompt builder.
The benefit of using a flow allows you to take in data from your records in Salesforce. You can then do calculations based on previously set business logic. Or you can create new functionality just for the prompt builder. The prompt could generate the responses needed based on the returned information from the flow.
Once you select the Flow from the resource list, it is then run as part of your functionality for the flex prompt.
In this example, we created a text message that provides the user with a discount. The discount is available if the order has been waiting for longer than 5 days without any activity.
Skull and Crossbones: Feature Warnings ☠️
Since these values are automatically returned there isn’t a way to review. The only area is in the preview for the response in the prompt template workspace area. And be aware that the response generated will not be exactly same each time. Responses maybe be similar but pay attention to the prompt details and the information given there.