Add Free Text Inputs to a Flex Prompt Template
Create a flex prompt template that includes free text inputs.
Required Editions
| Available in: Lightning Experience |
| Available in: Enterprise, Performance, and Unlimited Editions with the Einstein for Platform, or Einstein or Agentforce for Sales or Service add-on, or Agentforce Foundations |
| User Permissions Needed | |
|---|---|
| To create and manage prompt templates in Prompt Builder: | Prompt Template Manager permission set
OR Customize Application permission set |
Free text inputs are a non-record type of input field consisting solely of text. You can include free text input fields in your flex prompt templates in the same way that you include merge fields or other resources from the resource picker. This functionality allows you to handle scenarios where you want your prompt template to receive free text as an input. For example, customers submitting questions in a form field, reading a file and sending the contents to the prompt, or handling any situation where you want to send arbitrary text to a flex prompt template in Prompt Builder.
Imagine you’re a prompt admin and you want to design a prompt that answers a customer’s question about a specific product on your website. A flex prompt template that handles free text input is an elegant solution for this common situation elegantly. You can even use the opportunity to remind your customer about a current promotion you’re running.
To get started, create a prompt template.
- In the Prompt Template Type dropdown, select Flex.
- For the Prompt Template Name, enter Product Question Response and Promotion.
-
In the Define Sources section, define three sources.
- For the first row, enter Product in the Name field. Select Object as the Source Type. For the Object field, select Product. This row represents the product your customer is asking about.
- For the second row, enter User Question in the Name field. Select Free Text as the Source Type. This row represents the text input your customer provides, in the form of a question.
- For the third row, enter Promotion in the Name field. Select Object as the Source Type. For the Object field, select Product Service Campaign. This row represents the promotion you'll tell your customer about.
-
Click Next.
You’re redirected to the Prompt Template Workspace.
-
Write a prompt template from scratch, or copy and paste an example
template.
- If you want to base your prompt template on the template used in this example, copy and paste the example template text provided at the bottom of the page, and then edit it.
- Before you can run the template in Prompt Builder, in the Prompt section, click Insert Resource to use the search bar to replace the placeholders with real merge fields. The search field appears the first time you click this option.
- When the template is resolved into a prompt, the merge fields are replaced with real data and shown in the Resolved Prompt section.
- In the Preview Settings panel, select a product for the Product field, enter a sample question in the User Question field, and select a promotion for the Promotion field.
- Click Save & Preview to see the LLM-generated response.
Text from example:
A customer on our site is asking the following question about {!$Input:Product.Name}. Do your best to answer the customer's question.
'''
{!$Input:User_Question}
'''
In addition to answering their question, be sure to mention {!$Input:Promotion.ProductServiceCampaignName} to the customer.

