A prompt template is a reusable prompt that includes placeholders for details about customer, product, and more. Once these placeholders are populated with real data, it becomes a personalized prompt. The structure remains the same, but the content is customized for individual users or target groups. Once you've created the prompt template using the prompt builder, it can generate countless variations of personalized content based on your data. In addition to basic customization, you can also use Flow Builder to incorporate real-time data into the prompt template. In order to do so, you have to build a special flow type called Template-Triggered Prompt Flow.
How to Build a Template-Triggered Prompt Flow
Let's say that we have a Field Generation Prompt Template that works on the Account object and we want to provide information about the open Opportunity records. Here is how to build it.
1- After choosing Template-Triggered Prompt Flow as the flow type, you have to configure the start, just like record-triggered flows.
First of all, select the input type. Select "Automatic Inputs" to use the inputs provided by a specified prompt template type. You can also select "Manual Inputs" to manually create input variables to store prompt template information. If you select "Manual Inputs", then there is nothing else that you need to do in this screen. So, let's choose "Automatic Inputs".
Next, you have to select the prompt template type that has the automatic inputs to use. Available options are "Sales Email Template Capability", "Record Summary Template Capability", "Field Generation Template Capability", and any Flex prompt template that you have.
If you select "Sales Email Template Capability", then you have to choose the Recipient (Lead or Contact) and Related Object. If you select "Record Summary Template Capability" or "Field Generation Template Capability", then you have to select the Related Object only.
2- Add a Get Records element to get the open Opportunity records related to the Account. As you can see, $Input global variable stores the current Account record.
3- Add a Loop element to iterate through the Opportunity records. Then, add an Add Prompt Instructions element inside the loop. This element is available only in this flow type and works similarly to the Assignment element (so, don't worry about using it inside the loop).
You can use it to add content to prompt instructions. After the flow is completed, the prompt instructions are added to the associated prompt.
Each Add Prompt Instructions element appends content to the previous prompt instructions. To reference the prompt instructions in the flow, you can use the {!$Output.Prompt} global variable.
At the end, your flow should look like this.
Adding the Flow to Prompt Template
Next step is to add the flow to the prompt template, so that it can use the information from the flow.
Go the the Prompt Builder and add a new resource. Choose "Flows" and select the flow that you built.
Make sure that you add the flow to a logical place in your prompt instructions.
After you save and activate your prompt template, you can test your prompt template. Go to an account record, find the field that is using the prompt template (in our example, it is called Sales Summary), and use the prompt template.
As you can see, it listed 2 Opportunity records with the details we need and it mentioned that the close dates have passed.
Leave a Reply