CORE MODULE

Use Variables for Personalisation

What you'll learn in this guide

How to use question references and variables to personalise form content dynamically — showing a user's name in a question title, carrying a previous answer forward, or driving conditional logic from a calculated value.

Overview

CX Platform forms support a powerful variable and expression system. You can reference the value of any question anywhere in the form — in titles, descriptions, labels, HTML content, logic conditions, and calculated fields — using curly brace syntax.

This lets you build forms that feel personal and responsive. Instead of static question text, you can address users by name, confirm back what they've told you, and change what the form says based on what they've entered.

‍

Referencing question values

The core syntax is simple: wrap a question's name (not its label) in curly brackets and CX Platform will substitute the current value of that question wherever you use it.

{questionName}

‍

For example, if a question is named firstName and the user has entered "Sarah", then anywhere you write {firstName} in the form, it will render as "Sarah".

‍Example — Personalised question title

‍

Question name: firstName‍

Title of the next question: Thanks {firstName}, now please confirm your address.‍

Renders as: "Thanks Sarah, now please confirm your address."

‍Use the question Name, not the Title: The curly brace reference uses the question's Name field (set in the General tab of the field editor) — not the label or title displayed to the user. If the question is named q1, you reference it as {q1}, even if its displayed title is "What is your first name?"

‍

Where you can use variable references

Location Example
Question title Hi {firstName}, please confirm your details.
Question description / help text Your current address is listed as {address}. Update it below if this has changed.
Page title or page description Almost done, {firstName}. Just one more step.
HTML component content <p>You selected: <strong>{membershipType}</strong></p>
Completion message (Completed HTML) Thanks {firstName}, your application has been submitted.
Form Logic conditions {age} >= 18 or {email} == {confirmEmail}
Expression (read-only) field value {quantity} * {unitPrice} — calculates a total automatically.
Default value of a field Pre-populate a field with a value derived from a previous answer.

‍

Using prefilled data as variables

If a form is delivered as a private form with prefilled data, those prefilled values are also accessible via curly brace references — as long as the field's Value name is set in the Data tab of the field editor.

For example, if a field has its Value name set to surname and the form was pre-populated with the user's surname from your CRM, you can reference {surname} anywhere in the form to display that value.‍

‍Example — Confirming prefilled account data

HTML component content:

<p>We have the following details on file for your account:</p><p><strong>Name:</strong> {firstName} {surname}<br><strong>Account:</strong> {accountNumber}</p>

‍

This renders as a personalised summary using data supplied at form creation, before the user has typed anything.

Variables in Form Logic

Curly bracket references work the same way in Form Logic conditions — which is what makes logic genuinely dynamic. You can compare one question's value against another, check whether a calculated field meets a threshold, or evaluate a combination of inputs.

/* Show a follow-up question only if the user is over 18 */
{age} >= 18

/* Show a warning if the two email fields don't match */
{email} != {confirmEmail}

/* Complete the form early if membership type is "existing" */
{membershipType} == 'existing'

‍

Expressions in logic conditions can also use built-in functions — for example age({dateOfBirth}) to calculate age from a date field, or iif({hasPartner}, 'Yes', 'No') to return a string based on a boolean value.

‍

Useful expression functions

Function What it does
age({dateField}) Returns the current age in years calculated from a date field value.
iif(condition, valueIfTrue, valueIfFalse) Returns one value if the condition is true, another if false. Useful for setting question text or default values conditionally.
isContainerReady({panelName}) Returns true if all required questions in a panel are answered. Useful for gating progression.
sum({q1}, {q2}, {q3}) Returns the sum of the listed question values. Useful for totals in multi-row inputs.
count({arrayQuestion}) Returns the number of items selected or entered in a multi-value question.
today() Returns today's date. Useful for date comparisons or setting default date values.
diffDays({date1}, {date2}) Returns the difference in days between two date fields.

‍

Variable references are one of the most powerful tools in the form builder. Used well, they make forms feel like conversations rather than data entry — addressing users by name, confirming what they've said, and only asking what's relevant. Start with simple {questionName} references and build up to expressions and functions as you get comfortable with the syntax.

‍