<aside>

Description

The Prompt Builder is a visual tool for creating and managing AI prompts without code. It supports data connections from Salesforce via SOQL, JavaScript data transformation, response schema configuration, and prompt testing.

</aside>

What you can do


Step 1: Getting Started

  1. Open the Prompt Builder from the SimpleTranslate platform.
  2. Choose your starting point:

getting-started.png


Step 2: Set up your AI model

  1. Select your AI engine (the type of AI you want to use).
  2. Choose a specific model from the dropdown.

set-up-ypur-ai-model.png


Step 3: Understanding system parameters

When your prompt is called from Salesforce, these system parameters are available automatically:

You can use these in your prompts like $data, $recordId, or $objectApiName.

For testing, you can fill in these parameters manually in the Prompt Builder. When the prompt is called from Salesforce, your manual values are overwritten with the actual Salesforce data.

understanding-system-parameters.png


Step 4: Create your variables (optional but powerful)

Variables let you insert extra dynamic information into your prompts.

  1. In the left panel, select Add Variable.
  2. Choose a variable type:
  3. Name your variable (for example, customer_name or recent_cases).
  4. Set up the variable:

create-your-variable.png


Step 5: Add JavaScript scripts (optional – for simple data processing)

JavaScript scripts let you transform and enhance data before it reaches the AI.

Note: Only synchronous functions are supported.

  1. In the left panel, select Add Script.
  2. Write JavaScript with an execute() function that will be called.
  3. Access your data inside execute():

Simple example script

function execute() {
  // Get just the account names from the accounts variable
  const accountNames = accounts.map((acc) => acc.Name);

  // Count total cases
  const totalCases = recent_cases.length;

  // Return the processed data
  return {
    names: accountNames,
    caseCount: totalCases,
  };
}

Use script results in your prompts like script_name.names or script_name.caseCount.

add-java-script-file.png


Step 6: Write your prompt messages

  1. Add a system message (tells the AI how to behave).
  2. Add user messages (what the user will ask).
  3. Add variables to your messages:

write-your-prompt-message.png


Step 7: Configure response format

  1. Choose response type:
  2. If using JSON, define your schema (the structure you want), for example:
{
  "name": "salesforce_account",
  "strict": false,
  "schema": {
    "type": "object",
    "properties": {
      "Salutation": {
        "type": "string",
        "readOnly": true
      },
      "FirstName": {
        "type": "string",
        "description": "html",
        "readOnly": true
      },
      "LastName": {
        "type": "string",
        "readOnly": true
      }
    },
    "required": []
  }
}

To learn more about JSON Schema, see <https://json-schema.org/overview/what-is-jsonschema>.

<aside>

</aside>


Step 8: Test your prompt

  1. Fill in test values for your variables in the left panel.
  2. Select Test Prompt.
  3. Review the response in the right panel.
  4. Check token usage to understand costs.
  5. Adjust and test again until you are satisfied.

test-your-prompt.png


Step 9: Save and activate