Variables
Make your prompts dynamic and reusable with StickyPrompts’ powerful variable system. Variables allow you to create flexible prompt templates that can be customized for different contexts, users, and use cases.
Variable Basics
Section titled “Variable Basics”Variables in StickyPrompts are placeholders that you can replace with different values each time you use a prompt. They make your prompts flexible and reusable.
Variable Syntax
Section titled “Variable Syntax”Variables in StickyPrompts use a simple syntax:
{{VARIABLE_NAME}}
Common Uses
Section titled “Common Uses”Variables are particularly useful in these scenarios:
Hello {{USER_NAME}}, welcome to {{COMPANY_NAME}}!
Please analyze the following {{CONTENT_TYPE}}: {{CONTENT}}
Generate a {{STYLE}} email for {{AUDIENCE}} about {{TOPIC}}.
Variable Types
Section titled “Variable Types”StickyPrompts supports various variable types to handle different kinds of data.
Text Variables
Section titled “Text Variables”For simple text replacement:
**Variable:** {{PRODUCT_NAME}}**Example Value:** "StickyPrompts Pro"**Usage:** Write a review for {{PRODUCT_NAME}}
Numeric Variables
Section titled “Numeric Variables”For numbers and quantities:
**Variable:** {{WORD_COUNT}}**Example Value:** 500**Usage:** Write a {{WORD_COUNT}}-word article about {{TOPIC}}
Boolean Variables
Section titled “Boolean Variables”For conditional logic:
**Variable:** {{INCLUDE_EXAMPLES}}**Example Value:** true**Usage:** Explain {{CONCEPT}}. {{INCLUDE_EXAMPLES ? "Include practical examples." : "Keep it theoretical."}}
List Variables
Section titled “List Variables”For collections of items:
**Variable:** {{FEATURES}}**Example Value:** "Speed, Accuracy, Ease of use"**Usage:** Highlight these key features: {{FEATURES}}
Object Variables
Section titled “Object Variables”For complex, structured data:
**Variable:** {{USER_PROFILE}}**Example Value:**{ "name": "Sarah Johnson", "role": "Marketing Manager", "experience": "5 years", "industry": "SaaS"}**Usage:** Create a personalized message for {{USER_PROFILE.name}}, a {{USER_PROFILE.role}}
Variable Management
Section titled “Variable Management”Defining Variables
Section titled “Defining Variables”In the StickyPrompts Interface:
-
Prompt Editor
- Add variables directly in your prompt text
- Use the variable panel to define types and defaults
- Set validation rules and constraints
-
Variable Library
- Create reusable variable definitions
- Set global defaults and descriptions
- Organize by categories and use cases
-
Template Configuration
- Define required vs. optional variables
- Set variable dependencies and relationships
- Configure validation and error handling
Variable Defaults
Section titled “Variable Defaults”Set default values to make prompts work out-of-the-box:
{ "variables": { "TONE": { "default": "professional", "type": "text", "description": "The tone of voice for the response" }, "WORD_COUNT": { "default": 300, "type": "number", "min": 50, "max": 2000 }, "INCLUDE_CONCLUSION": { "default": true, "type": "boolean", "description": "Whether to include a conclusion section" } }}
Variable Validation
Section titled “Variable Validation”Ensure data quality with validation rules:
{ "variables": { "EMAIL": { "type": "text", "validation": { "pattern": "^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$", "error": "Please enter a valid email address" } }, "PRIORITY": { "type": "text", "validation": { "enum": ["low", "medium", "high", "urgent"], "error": "Priority must be: low, medium, high, or urgent" } }, "BUDGET": { "type": "number", "validation": { "min": 1000, "max": 1000000, "error": "Budget must be between $1,000 and $1,000,000" } } }}
Practical Examples
Section titled “Practical Examples”Content Creation Template
Section titled “Content Creation Template”Create a {{CONTENT_TYPE}} about {{TOPIC}} for {{TARGET_AUDIENCE}}.
## Requirements:- Length: approximately {{WORD_COUNT}} words- Tone: {{TONE}}- Style: {{WRITING_STYLE}}- Include SEO keywords: {{SEO_KEYWORDS}}
## Structure:1. Engaging introduction2. {{MAIN_POINTS}} main sections3. {{INCLUDE_EXAMPLES ? "Practical examples throughout" : "Theoretical focus"}}4. {{INCLUDE_CTA ? "Call-to-action at the end" : "Informational conclusion"}}
## Additional Context:{{ADDITIONAL_CONTEXT}}
Please ensure the content is {{QUALITY_LEVEL}} and suitable for {{PLATFORM}}.
Variable Configuration:
{ "CONTENT_TYPE": "blog post", "TOPIC": "sustainable energy", "TARGET_AUDIENCE": "homeowners", "WORD_COUNT": 800, "TONE": "informative yet approachable", "WRITING_STYLE": "conversational", "SEO_KEYWORDS": ["solar panels", "energy efficiency", "green technology"], "MAIN_POINTS": 3, "INCLUDE_EXAMPLES": true, "INCLUDE_CTA": true, "QUALITY_LEVEL": "high-quality", "PLATFORM": "company blog", "ADDITIONAL_CONTEXT": "Focus on cost savings and environmental benefits"}
Customer Service Template
Section titled “Customer Service Template”You are a customer service representative for {{COMPANY_NAME}}.
## Customer Context:- Name: {{CUSTOMER_NAME}}- Account Type: {{ACCOUNT_TYPE}}- Issue: {{ISSUE_DESCRIPTION}}- Priority: {{PRIORITY_LEVEL}}- Previous Interactions: {{PREVIOUS_INTERACTIONS}}
## Response Guidelines:- Tone: {{RESPONSE_TONE}}- Max Response Length: {{MAX_WORDS}} words- {{ESCALATION_REQUIRED ? "Prepare for escalation to supervisor" : "Resolve at first contact level"}}- {{OFFER_COMPENSATION ? "Consider appropriate compensation if needed" : "Focus on solution without compensation"}}
## Company Policies:{{RELEVANT_POLICIES}}
## Available Actions:{{AVAILABLE_ACTIONS}}
Please provide a helpful, professional response that addresses {{CUSTOMER_NAME}}'s concern about {{ISSUE_DESCRIPTION}}.
Email Marketing Template
Section titled “Email Marketing Template”Create an email for {{CAMPAIGN_TYPE}} targeting {{AUDIENCE_SEGMENT}}.
## Email Details:- Subject Line: Should mention {{KEY_BENEFIT}}- Preheader: {{PREHEADER_TEXT}}- Sender: {{SENDER_NAME}} from {{COMPANY_NAME}}
## Content Structure:1. **Opening:** Personalized greeting for {{RECIPIENT_NAME}}2. **Hook:** Compelling opening about {{MAIN_OFFER}}3. **Value Proposition:** Highlight {{VALUE_POINTS}}4. **Social Proof:** Include {{TESTIMONIAL_TYPE}}5. **Call-to-Action:** {{CTA_TEXT}} button6. **Urgency:** {{URGENCY_MESSAGE}}
## Personalization:- Industry: {{RECIPIENT_INDUSTRY}}- Company Size: {{COMPANY_SIZE}}- Previous Purchases: {{PURCHASE_HISTORY}}- Engagement Level: {{ENGAGEMENT_SCORE}}
## Constraints:- Length: {{EMAIL_LENGTH}}- Tone: {{BRAND_TONE}}- Compliance: {{COMPLIANCE_REQUIREMENTS}}
Create an engaging email that drives {{DESIRED_ACTION}} while maintaining {{BRAND_VOICE}}.
Advanced Variable Features
Section titled “Advanced Variable Features”Conditional Variables
Section titled “Conditional Variables”Use logic to show/hide content based on variable values:
Welcome to {{COMPANY_NAME}}!
{{if USER_TYPE === "premium"}}As a premium member, you have access to:- Priority support- Advanced features- Exclusive content{{endif}}
{{if USER_TYPE === "basic"}}Upgrade to premium to unlock:- Priority support- Advanced features- Exclusive content{{endif}}
{{if FIRST_TIME_USER}}Here's a quick tutorial to get you started:{{TUTORIAL_CONTENT}}{{endif}}
Variable Transformations
Section titled “Variable Transformations”Apply formatting and transformations:
**Uppercase:** {{PRODUCT_NAME | uppercase}}**Lowercase:** {{EMAIL | lowercase}}**Title Case:** {{ARTICLE_TITLE | titlecase}}**Currency:** {{PRICE | currency}}**Date:** {{EVENT_DATE | date("MMMM DD, YYYY")}}**Truncate:** {{DESCRIPTION | truncate(100)}}**Join List:** {{FEATURES | join(", ")}}
Variable Inheritance
Section titled “Variable Inheritance”Variables can inherit from parent templates:
{ "parent_template": "base_email_template", "inherited_variables": [ "COMPANY_NAME", "BRAND_COLOR", "CONTACT_INFO" ], "local_variables": { "CAMPAIGN_NAME": "Summer Sale 2024", "DISCOUNT_PERCENT": 25 }}
Dynamic Variable Generation
Section titled “Dynamic Variable Generation”Generate variables programmatically:
{ "dynamic_variables": { "CURRENT_DATE": "{{ new Date().toLocaleDateString() }}", "DAYS_UNTIL_EVENT": "{{ Math.ceil((eventDate - new Date()) / (1000 * 60 * 60 * 24)) }}", "PERSONALIZED_GREETING": "{{ getGreetingByTimeZone(userTimezone) }}", "RECOMMENDED_PRODUCTS": "{{ getRecommendations(userHistory, 3) }}" }}
Variable Organization
Section titled “Variable Organization”Naming Conventions
Section titled “Naming Conventions”Best Practices:
✅ GOOD NAMES:- USER_NAME- PRODUCT_CATEGORY- EMAIL_SUBJECT- RESPONSE_TONE- INCLUDE_EXAMPLES
❌ AVOID:- x- temp- data1- thing- variable
Naming Rules:
- Use UPPERCASE with underscores
- Be descriptive and specific
- Avoid abbreviations unless common
- Use consistent terminology
- Group related variables with prefixes
Variable Categories
Section titled “Variable Categories”User Information:
USER_NAMEUSER_EMAILUSER_ROLEUSER_DEPARTMENTUSER_EXPERIENCE_LEVEL
Content Parameters:
CONTENT_TYPECONTENT_LENGTHCONTENT_STYLECONTENT_TONECONTENT_FORMAT
Business Context:
COMPANY_NAMEINDUSTRYTARGET_MARKETBRAND_VOICECOMPETITIVE_ADVANTAGE
Technical Settings:
OUTPUT_FORMATQUALITY_LEVELPROCESSING_MODEERROR_HANDLINGVALIDATION_LEVEL
Variable Libraries
Section titled “Variable Libraries”Global Variables:
- Company information
- Brand guidelines
- Contact details
- Standard formatting
Department Variables:
- Role-specific terminology
- Department-specific processes
- Team preferences
- Local compliance requirements
Project Variables:
- Project-specific context
- Timeline information
- Stakeholder details
- Success metrics
Integration with AI Platforms
Section titled “Integration with AI Platforms”Platform-Specific Considerations
Section titled “Platform-Specific Considerations”ChatGPT Integration:
{ "chatgpt_variables": { "system_prompt_variables": [ "ROLE_DEFINITION", "EXPERTISE_LEVEL", "RESPONSE_STYLE" ], "user_prompt_variables": [ "TASK_DESCRIPTION", "CONTEXT_INFO", "OUTPUT_REQUIREMENTS" ] }}
Claude Integration:
{ "claude_variables": { "thinking_variables": [ "ANALYSIS_DEPTH", "REASONING_STYLE", "CONSIDERATION_FACTORS" ], "response_variables": [ "STRUCTURE_TYPE", "DETAIL_LEVEL", "VERIFICATION_NEEDS" ] }}
Gemini Integration:
{ "gemini_variables": { "multimodal_variables": [ "IMAGE_CONTEXT", "VISUAL_FOCUS", "CREATIVE_DIRECTION" ], "content_variables": [ "CREATIVITY_LEVEL", "EXPLORATION_DEPTH", "PERSPECTIVE_COUNT" ] }}
Performance and Security
Section titled “Performance and Security”Variable Performance
Section titled “Variable Performance”Optimization Tips:
- Cache frequently used variable values
- Use default values to reduce lookup time
- Batch variable resolution when possible
- Minimize complex transformations
- Pre-validate variable formats
Security Considerations
Section titled “Security Considerations”Variable Sanitization:
{ "security_rules": { "input_sanitization": { "remove_html": true, "escape_special_chars": true, "validate_length": true, "check_encoding": true }, "output_validation": { "scan_for_injection": true, "validate_format": true, "check_content_policy": true } }}
Access Control:
{ "variable_permissions": { "USER_PERSONAL_DATA": ["admin", "hr"], "FINANCIAL_DATA": ["admin", "finance"], "COMPANY_SECRETS": ["admin"], "PUBLIC_INFO": ["all"] }}
Troubleshooting Variables
Section titled “Troubleshooting Variables”Common Issues
Section titled “Common Issues”Issue: Variable Not Replacing
- Check variable name spelling
- Verify variable is defined
- Ensure proper syntax:
{{VARIABLE_NAME}}
- Check for extra spaces or characters
Issue: Invalid Variable Value
- Validate against defined constraints
- Check data type compatibility
- Verify required variables are provided
- Review validation rules
Issue: Performance Problems
- Reduce complex variable transformations
- Cache frequently used values
- Optimize variable resolution order
- Consider lazy loading for large datasets
Debugging Tools
Section titled “Debugging Tools”Variable Inspector:
{ "debug_mode": { "show_variable_values": true, "highlight_replacements": true, "log_resolution_steps": true, "validate_all_variables": true }}
Testing Framework:
{ "variable_tests": [ { "name": "Required variables present", "variables": ["USER_NAME", "TASK_TYPE"], "expected": "all_present" }, { "name": "Email format validation", "variable": "USER_EMAIL", "test": "email_format" } ]}
Best Practices
Section titled “Best Practices”Variable Design
Section titled “Variable Design”Keep It Simple:
- Use clear, descriptive names
- Avoid overly complex structures
- Set sensible defaults
- Provide helpful descriptions
Maintain Consistency:
- Use consistent naming patterns
- Apply uniform validation rules
- Follow company style guides
- Document variable purposes
Plan for Scale:
- Organize variables into logical groups
- Use inheritance where appropriate
- Create reusable variable libraries
- Consider future extensibility
Team Collaboration
Section titled “Team Collaboration”Documentation:
- Document all variables clearly
- Provide usage examples
- Explain validation rules
- Include troubleshooting guides
Governance:
- Establish naming conventions
- Define approval processes
- Set access controls
- Regular variable audits
Training:
- Train team on variable usage
- Share best practices
- Provide templates and examples
- Encourage consistent adoption
Variable Migration
Section titled “Variable Migration”Updating Variable Names
Section titled “Updating Variable Names”{ "migration_rules": { "old_name": "NEW_NAME", "user": "USER_NAME", "content": "CONTENT_TYPE", "length": "WORD_COUNT" }}
Version Control
Section titled “Version Control”{ "variable_versioning": { "version": "2.1", "changes": [ "Added USER_PREFERENCES variable", "Deprecated OLD_FORMAT variable", "Updated validation for EMAIL variable" ], "migration_guide": "See documentation for migration steps" }}
Next Steps
Section titled “Next Steps”Ready to master variables in StickyPrompts?
- Start with simple text variables in your first prompts
- Practice with the provided examples and templates
- Explore advanced features like conditionals and transformations
- Build your own variable library for common use cases
- Share best practices with your team
Variables are the foundation of powerful, scalable prompt management. Master them to unlock the full potential of StickyPrompts!