Skip to main content

Variables in Pollarix

Variables allow you to personalize surveys, emails, and SMS messages with dynamic data. Use them to create more engaging, relevant experiences for your respondents.

Variable Categories

Quick Reference

CategorySyntaxScopeExample
System{contact.*}Everywhere{contact.firstName}
Dynamic{paramName}Surveys & messages{customerTier}
Workflow{{params.*}}Workflow config{{params.apiToken}}

Variable Types

Built-in variables available everywhere:

VariableDescriptionExample Value
{contact.firstName}Contact's first name"John"
{contact.lastName}Contact's last name"Doe"
{contact.email}Contact's email"john@example.com"
{contact.phone}Contact's phone"+1234567890"
{survey.title}Survey title"Customer Feedback"
{collector.name}Collector/Campaign name"Q4 Campaign"
{coupon.code}Coupon code (if applicable)"SAVE20"

Trigger Timing

Understanding when triggers fire is critical for using variables correctly:

Trigger Comparison

TriggerWhen It FiresVariables Available In
Contact AddedBefore survey is sentSurveys AND messages
Survey OpenedWhen user clicks linkFollow-up messages only
Survey CompletedAfter submissionFollow-up messages only
Key Insight

Use Contact Added trigger for variables needed in surveys. Other triggers run after the survey is displayed.


Using Variables in Surveys

Making Workflow Variables Available

To use workflow parameters in survey questions:

  1. Use the "Contact Added" trigger (runs BEFORE the survey link is sent)
  2. Check the "In Survey" checkbox for the parameter
  3. Reference in survey using {parameterName} syntax
Hello {contact.firstName}! Based on your tier ({customerTier}),
we have a special offer for you.

Using Variables in Messages

Dear {contact.firstName},

Thank you for your interest! Your personalized offer code is: {offerCode}

Best regards,
The {collector.name} Team

Using Variables in Workflows

In workflow configurations, use double curly braces:

https://api.example.com/customers/{{contact.id}}
https://crm.company.com/surveys/{{survey.id}}/responses

Examples

Example 1: Personalized Survey with CRM Data

Goal: Show customer tier and personalized questions based on CRM data.

Setup:

  1. Add a Contact Added trigger to your workflow
  2. Add an HTTP Request step calling your CRM API
  3. Map responses: $.tiercustomerTier, $.scoreloyaltyScore
  4. Check "In Survey" for both parameters

In Survey:

Welcome back, {contact.firstName}!
As a {customerTier} member with {loyaltyScore} points,
you qualify for exclusive rewards.

Example 2: Dynamic Discount Based on API

Goal: Fetch personalized discount from pricing API before survey.

In Survey:

Great news! You're eligible for {discount}% off your next purchase.

Example 3: Post-Survey Coupon

Goal: Send coupon after survey completion.

In Email:

Thanks for the great feedback, {contact.firstName}!
Here's your reward: {coupon.code}

Best Practices

PracticeDescription
Use correct trigger"Contact Added" for survey variables
Keep names simpleUse camelCase (e.g., customerTier)
Test with sample dataBefore launching your collector
Document variablesIn collector description for team reference
Handle missing dataConsider what happens if an API call fails
Use proper syntax{var} in surveys, {{params.var}} in workflows

Troubleshooting

Variables not appearing in survey

Common causes:

  • Wrong trigger: Make sure you're using "Contact Added" trigger
  • "In Survey" not checked: Ensure the checkbox is enabled for the parameter
  • Timing issue: Other triggers run too late for survey variables

Solution: Review your workflow and ensure the trigger fires before the survey is displayed.

API data not available

Common causes:

  • HTTP step error: Verify the URL and method are correct
  • Response mapping wrong: Ensure JSON paths match your API response
  • API failure: Review workflow execution logs for errors

Solution: Check the execution logs in your workflow for detailed error messages.

Variables showing as placeholders

Common causes:

  • Wrong syntax: Use {variableName} in surveys, {{params.variableName}} in workflows
  • Spelling error: Variable names are case-sensitive
  • Variable not created: Ensure the parameter exists

Solution: Double-check your variable syntax and spelling.

Variables work in messages but not surveys

Common causes:

  • Wrong trigger: Using "Survey Completed" instead of "Contact Added"
  • "In Survey" not checked: Parameter not marked for survey access

Solution: Use "Contact Added" trigger and enable "In Survey" checkbox.


Next Steps

Was this page helpful?