Variables & Presets
Create dynamic prompts with variables and save commonly used input combinations as presets for efficient testing.
Variable Syntax#
Variables allow you to create reusable prompt templates with dynamic content. Use double braces to define variables in your prompts:
Hello {{name}}, welcome to {{company}}!
Your role is {{role}} and you specialize in {{domain}}.Variables are automatically detected when you save a prompt. They appear in the Playground as input fields that you can fill in before running.
Naming Conventions
user_name, product_category, target_audience.Variable Types#
PromptReports supports different variable types for various use cases:
| Type | Syntax | Description |
|---|---|---|
| Text | {{variable}} | Single-line text input |
| Long Text | {{variable:textarea}} | Multi-line text input |
| Number | {{variable:number}} | Numeric input with validation |
| Select | {{variable:select:opt1,opt2,opt3}} | Dropdown with predefined options |
| Boolean | {{variable:boolean}} | True/false toggle |
Analyze the {{product:select:software,hardware,service}} for {{company}}.
Budget constraint: ${{budget:number}}
Detailed requirements:
{{requirements:textarea}}
Include competitor analysis: {{include_competitors:boolean}}Presets#
Presets are saved collections of variable values that you can quickly load in the Playground. They're useful for:
Quick Testing
Reload common test scenarios with one click.
Reproducibility
Save exact inputs that produced good results.
Dataset Creation
Convert presets into test dataset rows.
API Examples
Use presets as reference for API integration.
Fill in Variables
Click Save Preset
Name Your Preset
Load Anytime
Default Values#
You can specify default values for variables using the colon syntax:
You are a {{role:helpful assistant}} working for {{company:PromptReports}}.
Response length: {{length:medium}} (short, medium, or long)
Tone: {{tone:professional}}Default values are used when:
- Running the prompt without explicitly setting the variable
- Making API calls without providing all variables
- Creating test datasets with partial data
Empty Defaults
API Integration#
When calling prompts via the API, pass variable values in the request body:
{
"promptId": "prompt_abc123",
"variables": {
"name": "John Doe",
"company": "Acme Corp",
"role": "Software Engineer"
},
"model": "gpt-4",
"temperature": 0.7
}The API will substitute all variables before sending to the AI model. Missing required variables will return a 400 error with details about which variables are missing.
Best Practices#
Follow these guidelines for effective variable usage:
- Be descriptive: Use clear variable names that indicate expected content
- Group related variables: Place related variables together in the prompt
- Use defaults wisely: Set sensible defaults for optional parameters
- Document expectations: Add comments in your prompt about expected variable formats
- Test edge cases: Create presets for unusual or edge case inputs
- Keep it simple: Don't over-parameterize; only use variables for truly dynamic content