Add File Inputs to a Flex Prompt Template
Create a flex prompt template that includes image files.
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 |
Here’s an example scenario of a flex prompt template that uses a file input. Say you're designing a prompt template to verify product images in an e-commerce listing before publication. Your Flex prompt template compares uploaded product images to the listing description to ensure that colors, sizes, and details are accurately represented. You're interested because this prompt template helps maintain consistency across listings and improves product accuracy and customer trust.
To get started, create a prompt template.
- In the Prompt Template Type dropdown, select Flex.
- For the Prompt Template Name, enter Image Comparison.
- In the description field, enter E-Commerce Product Image Verification
-
Define three resources. For the first image, enter:
- Name: Image1
- API Name: Image1
- Source Type: Object
- Object: File
- Click Add.
-
For the second image, enter:
- Name: Image2
- API Name: Image2
- Source Type: Object
- Object: File
- Click Add.
-
For the product description, enter:
- Name: Description
- API Name: Description
- Source Type: Object
- Object: Product2
- Click Next, and you’re redirected to the Prompt Template Workspace.
-
Copy and paste the example prompt template
- To use the example prompt, copy the E-Commerce Product Image Verification prompt in the Flex Example Templates. Then, paste it into the Prompt Template Workspace.
- Before you can run this template in Prompt Builder, in the Prompt section, click Insert Resource.
- In the Inputs menu, replace the description placeholder with a real merge field.
- Add the related list to the prompt template, from the Resource picker, click Product2, then Notes & Attachments.
- In Template Settings, under Model, select GPT 4 Omni.
- In Preview Settings, click Inputs. In the Inputs section, you see the three objects that you created.
- Click Select File to choose a file stored in your org. You can select an existing file or upload a new one.
- Select a product for your description grounding data.
- After the files and the product description are added, click Save & Preview to test the prompt template. You can also preview attached images in the Resolved Prompt section.
Did this article solve your issue?
Let us know so we can improve!

