<aside>
Description
The Prompt Builder is a visual, no-code editor for building AI prompts connected directly to your Salesforce data. Define your inputs, configure your AI model, write and test your messages, then deploy — all from one workspace. Versioning, environment promotion, and cloning are built in.
</aside>
What you can do
- Build AI prompts – Write structured messages that define how your AI should behave and what it should process
- Connect live Salesforce data – Pull real-time records into your prompts using system parameters and SOQL queries
- Test before you deploy – Run your prompt against real data and review the AI response instantly, including token usage
- Manage versions – Save snapshots of your prompt, activate any version, and roll back in seconds
- Promote and clone – Push prompts to other environments or duplicate them within the same environment
Step 1: Getting Started
- Open the Prompt Builder from the SimpleTranslate platform.
- Choose your starting point:
- Select Create New Prompt to start fresh.
- Select an existing prompt from the list to edit it.

The editor opens in a three-panel layout:
- Left panel – Your data inputs and variables
- Center panel – AI settings and message editor
- Right panel – Test output

Step 2: Set up your AI model
In the center panel, configure which AI model will process your prompt.
-
Select your AI Engine from the dropdown. Supported providers include OpenAI, Anthropic, Google Gemini, and AWS Bedrock.
-
Choose a specific AI Model from the list — the models available depend on the selected engine.

-
Select a Target Credential to connect the prompt to your Salesforce org. This is required for SOQL variables and for testing with live data.
Step 3: Understanding system parameters
When your prompt runs from Salesforce, these parameters are provided automatically — you do not need to define them:
data – The full record data as a JSON object. Access specific fields with dot-notation: {{$data.fieldName}}
recordId – The ID of the current Salesforce record
objectApiName – The API name of the current Salesforce object
sfUserId – The Salesforce user ID you provide
Use these in your messages with double curly brace syntax: {{$data}}, {{$recordId}}, {{$objectApiName}}, {{$sfUserId}}.
For testing, fill in the parameter values manually in the left panel. When the prompt runs from Salesforce, these values are automatically replaced with real data from the record.

Step 4: Create your variables
Variables let you bring in additional data beyond the system parameters. They appear in the left panel and can be dragged directly into your messages.
- In the left panel, click New Variable.
- Choose a variable type:
- Text – A fixed text value you define manually. Use this for static context like instructions or fixed identifiers.
- JSON – A fixed JSON object. Access nested values with dot-notation:
{{$myVar.key}}.
- SOQL Query – A live query that runs against your connected Salesforce org every time the prompt executes, returning fresh data.
- Give your variable a name — for example,
recent_cases or account_info. Variable names cannot match system parameter names (data, recordId, objectApiName, sfUserId).
- For SOQL variables:
- Select a Target Credential to connect to your Salesforce org.
- Write your query. Example:
SELECT Name, Status FROM Case WHERE AccountId = '{{$recordId}}'
- Use the SOQL Tools panel for pre-built query templates, aggregate functions (SUM, COUNT, AVG, MIN, MAX), and operator chips.
- Click Test Query to run the query live against Salesforce and preview the results inline before saving.
- Click Improve Query (wand icon) to have the AI validate and correct the query automatically.

Step 5: Write your prompt messages
The center panel is where you write the instructions your AI follows. A prompt can have multiple messages, each with its own role.
- Click Add Message to add a new message row.
- Set the role using the dropdown on the right of each row:
- System – Defines how the AI behaves. Write your instructions, persona, tone, and any rules or constraints here. Example: "You are a customer service assistant. Always respond professionally and reference specific case details from the data provided."
- User – The actual input the AI processes and responds to. This is where you include the data or question. Example: "Summarize this support case and suggest the next best action: {{$data}}"
- Assistant – A pre-written AI response used to set the conversation style (optional, for advanced use).
- To insert a variable, drag it from the left panel directly into the message text. Variables are highlighted in the editor so you can see exactly what data will be injected at runtime.
- Use the Improve Text button (wand icon) on any message to have the AI refine the wording while keeping all variable references exactly as they are.
Step 6: Configure response format
- In the center panel, open the Response Format dropdown and choose:
- Text – The AI returns a plain text response. Use this for summaries, emails, briefings, or any free-form output.
- JSON Schema – The AI returns a structured JSON object matching a schema you define. Use this when the output needs to feed directly into another Salesforce component or system.
- If you select JSON Schema, the schema editor opens. Define the structure of the JSON output you expect the AI to return.
- Click Generate from Salesforce to build a schema automatically — select a Salesforce object, choose which fields to include, and the schema is generated for you.
- Click Prettify to auto-format the schema. Validation errors are shown inline with the affected line highlighted in red.
Important: When the prompt is called from Salesforce with a JSON schema parameter, that schema overrides the one defined here. When called from a Flow, the schema defined in the Prompt Builder is used.
Step 7: Test your prompt
Before activating, test with real data to confirm the output is correct.
- In the left panel, fill in test values for your system parameters (
recordId, objectApiName, data) to simulate a real Salesforce record.
- Click Test Prompt in the header.
- The system resolves all variable references, runs any SOQL queries live against your Salesforce org, sends the assembled messages to your selected AI model, and displays the result in the right panel.
- Review the response in the right panel. Token usage is shown at the top — total tokens consumed with a breakdown of input vs. output — so you can monitor cost.
- Adjust your messages, variables, or model settings and test again until the output is correct.

Step 8: Save and activate
- Give your prompt a unique API Name — this is the identifier Salesforce components use to call it.
- Add a descriptive Label for display in the Prompt Builder list.
- Click Save.
- Click Activate to publish the prompt. Only Active prompts execute when called from Salesforce. Inactive or Draft prompts do not run.
Step 9: Save as New Version
The Prompt Builder stores up to 30 versions per prompt. Each version is a complete snapshot of your messages, variables, model configuration, and response schema — you can experiment freely without affecting what is currently live.