Follow the journey + support the build: https://ko-fi.com/promptwaffle
#promptwaffle #buildinpublic #steamdev #indiedev #aiarttools #promptbuilder #creativeworkflow
Just added thumbnail previews for reference images in PromptWaffle. It's a small fix, but it makes a big difference when you're visually assembling prompts.
Eventually I’d love to sync it to your AI image save folder so it updates automatically (Comfy, MJ, etc).
Support here: https://ko-fi.com/promptwaffle
#PromptWaffle #AIArtTools #BuildInPublic #ComfyUI #PromptBuilder #GenerativeArt
How To Build Flex and Field Generation Prompt Templates in the Prompt Builder
Prompt engineering is one of the most important skills of our era. With the speedy adoption of AI Large Language Models, the use of language became a very important skill again. One could argue that effective natural language writing will potentially be more important than coding in the future. Prompt writing is also critical for Salesforce Agentforce.
While writing in English – or any other language that the LLM understands – is important, we need to keep in mind how LLMs work so that we can design well-written instructions, establish guardrails, and ground our prompts to produce accurate results.
Writing prompts is not necessarily a Salesforce skill. This is now a universally sought-after skill that everyone needs to master.
Introduction to Prompt Builder
Prompt Builder is a tool to facilitate the creation of AI prompts within Salesforce, enabling users to automate responses based on specific data inputs. This tool is essential for reducing inefficiency when delivering results, thereby increasing operational efficiency across various business functions.
Integration with Salesforce Flow and Apex
Prompt Builder is very well integrated with Salesforce Flows and Apex. This integration allows for excellent customization and functionality expansion, enabling users to execute sophisticated prompts through elaborate workflows and automate intricate tasks. Additionally, it facilitates simple data retrieval from multiple sources, including Salesforce’s Data Cloud and external APIs.
Salesforce Prompt Template Types
Here are all Salesforce Prompt Template Types:
We will use field generation and flex types for this post.
Real-World Applications
Prompt template is an excellent tool when summarizing the history of a customer and producing recommended actions. This tool can also expedite the process of documenting the actions taken.
🚨 Use case 👇🏼Automating the generation of coaching notes can reduce manual processing time from 30 minutes to under 5 minutes.
Data Model
For this use case, I picked a simple data model. The coaching session object is related to the contact for the client. A coaching session record will be created whenever a session is scheduled or delivered. The status field determines whether a session is scheduled or completed. When a new session is scheduled, the date and time of the session is stamped via a record-triggered flow on the client contact record as the next (upcoming) session date and time.
The client contact record also has fields that hold the client’s subscription information and their interests.
Most importantly, all the past coaching session notes need to be considered when preparing for the next session.
Field Generation Prompt Template
The coaching session object includes the preparation notes rich text field. When a new coaching session is scheduled a new record is created. Before the coach goes to this session, they can go into this record and generate preparation notes for their upcoming session.
Field Preparation and Field Generation Prompt Template Creation
Field generation prompt template receives the coaching session record as input. When setting up this prompt template type, you need to scope it for a text or rich text field. Therefore, remember to create this field before you open your prompt builder. In this case, we will scope this prompt template for the preparation notes rich text field.
Record Input
Your prompt template will access all field values of the record it is built on. You can also traverse to related records. You can use field values of the parent records, but referring to related records this way is not very helpful. Your prompt template cannot see a meaningful summary of the related records.
Template-Triggered Prompt Flow Input
This is where flow input comes in handy. You can create a Template-Triggered Prompt Flow and make that flow accessible from your prompt template. Based on my experience, I can say it is quite tricky to make this flow available inside your prompt builder resource picker. I think there is a bug that is scheduled to be fixed soon, that is preventing the flow from showing up in the prompt builder in some cases.
For this use case, I built a flow that retrieves all the past completed coaching sessions and pastes the relevant information into the prompt for the template to consume.
Building the flow is not that difficult, but you will need to loop if you want to summarize multiple records.
Here is how you build the flow:
---Here is one completed past coaching session details: Title: {!Loop_Sessions.Title__c}Preparation Notes: {!Loop_Sessions.Preparation_Notes__c}Session Notes: {!Loop_Sessions.Session_Notes__c}Duration (in hrs): {!Loop_Sessions.Duration__c}Status: {!Loop_Sessions.Status__c}---There are no other completed coaching sessions found for this client.This is what your flow should look like.
Writing the Prompt Template Instructions
Important things to watch for:
Save your prompt template and test it. Save a new version when needed. You will need to point the prompt template to an existing record in Salesforce, therefore create a coaching session record before you test. Read the resolution and response carefully. Make iterations and improve the template. Save and activate your work.
Field Generation Prompt Template Content
Here is my complete prompt template content. You can copy and paste this to get started. Remember to delete the inputs, and insert them from your resource picker for accuracy.
Your Job is to provide a note and guidance for the Coach on what they need to know for an upcoming Coaching Session. This response will be used to populate the session preparation notes field on the Coaching Session record.Use the following context to ground your final responseContext:Client's Name: {!$Input:Coaching_Session__c.Contact__r.Name}Client's Birthday: {!$Input:Coaching_Session__c.Contact__r.Birthdate}Client's Next Scheduled Session Date: {!$Input:Coaching_Session__c.Contact__r.Next_Scheduled_Session__c}Is Client a Subscriber: They are if the value of is true.Client's Subscriber Type: {!$Input:Coaching_Session__c.Contact__r.Subscriber_Type__c}Client's Interest Areas: {!$Input:Coaching_Session__c.Contact__r.Interests__c}Recent coaching sessions (these are the recently completed coaching session notes separated by "---", extract past experience and interests): {!$Flow:Coaching_Session_PTF_Past_Completed_PT_Flow.Prompt}Note on Subscriber Types:There are three types: "Career", "Personal" and "General"- "Career" focuses on progress and advancement at the work place- "Personal" focuses on wellbeing and happiness outside of work.- "General" is a healthy mix of the two other types.Note on Session Types:There are 2 types of Session Types Inaugural (first) and Follow-up sessions. Specify which type is relevant and the duration of the session. If there are one or more than one completed past coaching session records, then the Follow-up session type will be used, otherwise Inaugurual will be set up.- Inaugural: If the client does not have any previous consultation on record, then this format will be used. This coaching session will be guided toward setting up a plan with the client. Discussions should be centered around making sure they have the proper readiness to start, discussing their interests, discussing their past experience, providing them with a few guidance tips on getting started, and telling them what to expect. Usually go for 1.5 hour. A follow-up is usually scheduled for one month after the first one (this session).- Follow-up: These sessions are monthly check-ins with the customers to review their progress and answer questions for them based on what they are dealing with. Usually go for 1 hour.Note on birthdays: Customers with upcoming and past birthdays, within 30 days of the next session scheduled date ( {!$Input:Coaching_Session__c.Contact__r.Next_Scheduled_Session__c}) will get a free digital book. Please add this detail into the notes if the birthdate is within 30 days of the next scheduled session. If no birthday is provided on the client contact record, or the birthdate is not within 30 days of the next scheduled session do not include this information.- If {!$Input:Coaching_Session__c.Contact__r.Is_Subscriber__c} value is false then the client is not subscribed. Warn the coach: Include a message saying confirm subscription before visit. If the client is subscribed (value = true) do not include a message for the coach about this.Response:- Your response should give the coach information to go into the consultation and know what to discuss with the customer.- Your response should contain important information about the customer, their interests, structure on how the coaching session should go, guidance for their client based on interests and past experience.- Use break-lines in your response to segment between different ideas- We are writing for a Salesforce Rich Text Field, so you'll need to follow this guidance below:- Provide output in HTML format. Only Output the text inside the tag pair.- Use bullets or numbered lists to highlight key points.- Enhance readability by adding rich text formatting (i.e., font, text color, background color, etc.) where possible.- Add HTML tags to improve readabilityAdding the Prompt Template to the Page Layout
Once the prompt template is finished, you need to add the prompt template to the page layout. Go to the object lightning page layout, activate dynamic forms if not already active, pick the preparation notes field and link it to the prompt template you have created.
Field Generation Result
Here is the result of the field generation prompt template on the record.
Flex Prompt Template
Flex prompt template is a more powerful tool. You can set it up using the prompt text you have already created. Flex prompt template can accept up to five different inputs of various different types. They can be built into Agentforce actions and used by Agentforce topics.
Currently, prompt template inputs cannot be changed once configured. You will need to create a new prompt template if you want to change inputs. Therefore, always add at least one free text input when configuring a flex prompt template. This will give you the flexibility you need, if you need to add additional instructions or data to your prompt.
Object Preparation and Flex Prompt Template Creation
The input types you can use, when creating a flex prompt template are:
For this template type, you can input any object you want. They don’t have to be related. You need to makes sure you create you object before you build your template, if you are working with custom objects.
You also don’t specify fields when you build a flex template. Your template will have access to all the fields on the record that will be inputted into the template.
Flex Template Inputs
For this use case we will use three input variables:
We could use just the coaching session Id here, but the additional inputs will give us flexibility in how we process different scenarios. For example: We may decide to use this prompt template even before the first session is scheduled, therefore prompt template could work just by receiving the client contact Id.
Reuse Template Triggered Flow Input
I found that I can reuse the same flow I created for the field generation prompt template. This flow should be accessible for you in your resource picker, when you are building your prompt.
Writing Flex Prompt Template Instructions
The prompt template content for this will be very similar to the field generation example. The main difference will be that you will refer to three inputs and the flow input for this template type. You can start with your own template from the previous example and modify it to fit the needs of the flex template. Or you can use my content provided in the code block below to get started.
Once you finish your first pass, save your prompt template and test it. Save a new version when needed. You will need to point the prompt template to existing records in Salesforce, therefore create a coaching session record before you test. You can add additional data and instructions in the free text input field. Read the resolution and response carefully. Make iterations and improve the template. Save and activate your work.
Flex Prompt Template Content
Here is my complete prompt template content. You can copy and paste this to get started. Remember to delete the inputs, and insert them from your resource picker for accuracy.
Your Job is to provide a note and guidance for the Coach on what they need to know for an upcoming Coaching Session.Use the following context to ground your final responseContext:Client's Name: {!$Input:ClientIdVar.Name}Client's Birthday: {!$Input:ClientIdVar.Birthdate}Client's Next Scheduled Session Date: {!$Input:ClientIdVar.Next_Scheduled_Session__c}Is Client a Subscriber: They are if the value of {!$Input:ClientIdVar.Is_Subscriber__c} is true.Client's Subscriber Type: {!$Input:ClientIdVar.Subscriber_Type__c}Client's Interest Areas: {!$Input:ClientIdVar.Interests__c}Recent coaching sessions (these are the recent completed coaching sessions that will give you interest and past experience information):{!$Flow:Coaching_Session_PTF_Past_Completed_PT_Flow.Prompt}Note on Subscriber Types:There are three types: "Career", "Personal" and "General"- "Career" focuses on progress and advancement at the work place- "Personal" focuses on wellbeing and happiness outside of work.- "General" is a healthy mix of the two other types.Note on Session Types:There are 2 types of Session Types Inaugural (first) and Follow-up sessions. If there are one or more than one completed past coaching session records, then the Follow-up session type will be used, otherwise Inaugural will be set up.- Inaugural: If the client does not have any previous consultation on record, then this format will be used. This coaching session will be guided toward setting up a plan with the client. Discussions should be centered around making sure they have the proper readiness to start, discussing their interests, discussing their past experience, providing them with a few guidance tips on getting started, and telling them what to expect. Usually go for 1.5 hour. A follow-up is usually scheduled for one month after the first one (this session).- Follow-up: These sessions are monthly check-ins with the customers to review their progress and answer questions for them based on what they are dealing with. Usually go for 1 hour.Note on birthdays: Customers with upcoming and past birthdays, within 30 days of the next session scheduled date ( {!$Input:ClientIdVar.Next_Scheduled_Session__c} ) will get a free digital book. Please add this detail into the notes if the birthdate is within 30 days of the next scheduled session. If no birthday is provided on the client contact record, or the birthdate is not within 30 days of the next scheduled session do not include this information.Note on Recent Coaching Session records: The recent orders should contain client's interests and past experience.If there are additional notes, they will be provided in {!$Input:FreeTextVar}. Please take these into consideration.Response:- If {!$Input:ClientIdVar.Is_Subscriber__c} value is false then the client is not subscribed. Warn the coach: Include a message saying confirm subscription before visit. If the client is subscribed (value = true) do not include a message for the coach about this.- Your response should give the coach information to go into the consultation and know what to discuss with the customer.- Your response should contain important information about the customer, their interests, structure on how the coaching session should go, guidance for their client based on interests and past experience.- Use break-lines in your response to segment between different ideas- We are writing for a Salesforce Rich Text Field, so you'll need to follow this guidance below:- Provide output in HTML format. Only Output the text inside the tag pair.- Use bullets or numbered lists to highlight key points.- Enhance readability by adding rich text formatting (i.e., font, text color, background color, etc.) where possible.- Add HTML tags to improve readabilityAdding Your Flex Prompt Template to Agentforce
I will cover this topic in an upcoming post.
Conclusion
As artificial intelligence continues to redefine the landscape of business processes, tools like Salesforce’s Prompt Builder stand at the forefront of this technological revolution. The insights provided by Jaswinder Rattanpal at TrailblazerDX 2025 inspired this demo and the post. There is no doubt everyone needs to master prompt engineering to prepare for the AI future.
For Salesforce users and enthusiasts looking to discover more about the capabilities of Prompt Builder, the platform provides comprehensive learning and support through Trailhead, hands-on workshops, and a vibrant community forum. Finally, remember to check back at Salesforce Break for additional posts on Prompt Templates and Agentforce AI.
Explore related content:
Salesforce AI: Transforming Data into Sales Engagement
New Agentforce Specialist Certification
How to Get Your AI-Powered Enhanced Developer Org with Agentforce and Data Cloud
#Agentforce #AI #AISpecialist #Einstein #PromptBuilder #Salesforce #SalesforceAdmins #SalesforceDevelopers
Have you been having trouble getting ChatGPT or Copilot to give you what you want? Logitech released a free AI prompt builder that could help.
#AIPrompts #PromptBuilder https://www.msn.com/en-us/lifestyle/shopping/logitech-s-free-ai-prompt-builder-is-surprisingly-handy-here-s-how-i-m-using-it/ar-AA1njzmW
Have you been having trouble getting ChatGPT or Copilot to give you what you want? Logitech released a free AI prompt builder that could help.
#AIPrompts #PromptBuilder
https://www.msn.com/en-us/lifestyle/shopping/logitech-s-free-ai-prompt-builder-is-surprisingly-handy-here-s-how-i-m-using-it/ar-AA1njzmW
Download the "Microsoft AI Builder Prompting Guide"!
This dives into the art of prompt engineering, providing insights on creating effective prompts to maximize AI. From summarization to sentiment analysis, learn how to harness AI's in Power Platform with custom prompts.
A must-read for anyone looking to enhance their AI skills.
DOWNLOAD (.PDF): https://go.microsoft.com/fwlink/?linkid=2255775
DOCS: https://learn.microsoft.com/en-us/ai-builder/create-a-custom-prompt
#AIBuilder #PromptEngineering #PowerPlatform #AI #PromptBuilder #microsoft #msftadvocate