NueForm

Variables

Use answer variables, URL variables, and form variables to create dynamic, personalized forms with real-time text substitution.

Overview

Variables in NueForm let you create dynamic, personalized form experiences. You can reference respondent answers, URL parameters, and custom form variables anywhere in your question titles, descriptions, welcome screens, and thank-you screens using the {variableName} substitution syntax.

Types of Variables

NueForm supports three types of variables:

1. Answer Variables

Answer variables capture a respondent's answer to a specific question and make it available for use in later questions.

How to set up:

  1. Select a question in the form builder.
  2. In the question settings, find the Answer Variable field.
  3. Enter a variable name (e.g., name, company, rating).
  4. The respondent's answer to that question is now stored as {name}, {company}, or {rating}.

Example:

  • Question 1: "What is your name?" (Answer Variable: name)
  • Question 2 title: "Nice to meet you, {name}! What brings you here today?"

When the respondent types "Sarah" for Question 1, Question 2 will display: "Nice to meet you, Sarah! What brings you here today?"

Value coercion:

Answer TypeStored As
Text (string)The text value directly
NumberThe numeric value as a string
Boolean (Yes/No)"true" or "false"
Array (multi-select)Comma-separated values (e.g., "Option A, Option B")
Object (contact info, address)JSON string
Null/undefinedEmpty string

2. URL Variables

URL variables are values passed to the form through URL query parameters. They are available immediately when the form loads, before any questions are answered.

How to use:

Append query parameters to your form URL:

text
https://nueform.io/f/my-form?firstName=John&company=Acme&source=email

These parameters are automatically available as variables:

  • {firstName} resolves to "John"
  • {company} resolves to "Acme"
  • {source} resolves to "email"

Use cases:

  • Pre-populate form fields with known data.
  • Personalize greetings: "Hi {firstName}, we have some questions for you."
  • Track referral sources in your response data.
  • Route respondents using start logic jumps based on URL parameters.

URL variables can also be used in logic jump conditions. Reference them by prefixing the variable name with url: in the condition field (e.g., url:source). URL variable lookups support case-insensitive fallback, so ?FirstName=John will match a condition on url:firstname.

3. Form Variables

Form variables are predefined variables with a name, type, and default value. They are defined at the form level and can be modified by variable actions in logic jumps.

How to define:

Form variables are defined in the form's variable definitions and have the following properties:

PropertyDescription
NameThe variable name (e.g., score, category, is_qualified).
TypeEither number or string.
Default ValueThe initial value when the form loads.

How they are modified:

Form variables are modified through variable actions on logic jumps. When a logic jump's condition matches, its associated variable actions execute:

ActionDescriptionExample
setReplace the variable's value.Set category to "premium"
addAdd a number to the variable.Add 10 to score
subtractSubtract a number from the variable.Subtract 5 from score

Example: Building a score calculator

  1. Define a form variable: score (type: number, default: 0).
  2. On each question, add logic jumps with variable actions:
    • If Rating >= 4, add 10 to score.
    • If Rating >= 2, add 5 to score.
  3. On the thank-you screen: "Your score is {score} out of 50."

Substitution Syntax

The {variableName} syntax works in the following locations:

LocationSupported
Question titlesYes
Question descriptionsYes
Welcome screen titleYes
Welcome screen descriptionYes
Thank-you screen titleYes
Thank-you screen descriptionYes
Form titleYes
Form descriptionYes
Choice labelsNo
Button textNo
QR Code URL templatesYes

How Substitution Works

  1. The system scans text for {variableName} patterns (single curly braces with word characters inside).
  2. It looks up the variable name in the current variables map.
  3. If found, the token is replaced with the variable's value.
  4. If not found, the token is replaced with an empty string.

Variable names use single curly braces {name}. Do not confuse this with the Markdown inline field syntax, which uses double curly braces {{type:label}}. The two syntaxes are intentionally different and do not conflict.

Variable Detection

NueForm automatically detects all variables referenced across your form by scanning:

  • {variableName} tokens in all text fields (titles, descriptions, welcome/thank-you screens).
  • url: prefixed fields in logic jump conditions.
  • Variable names in logic jump actions.
  • answerVariable declarations on questions.
  • Form-level variable definitions.

This comprehensive scan produces a sorted, deduplicated list of all variable names used in your form.

Variable Resolution Order

When resolving a {variableName} token, NueForm checks variables in this order:

  1. URL variables -- passed through the form URL.
  2. Answer variables -- set by the respondent's answers to questions with answerVariable configured.
  3. Form variables -- defined at the form level and modified by logic jump actions.

If the same variable name exists in multiple sources, URL variables take precedence (since they are the source passed to the substitution function along with form/answer variables merged in).

Examples

Personalized Welcome

URL: https://nueform.io/f/feedback?name=Sarah&product=Widget

Welcome Title: "Hi {name}!" Welcome Description: "We'd love to hear your thoughts on {product}."

Result: "Hi Sarah!" / "We'd love to hear your thoughts on Widget."

Dynamic Follow-up Questions

Question 1: "What is your role?" (Answer Variable: role) Question 2: "As a {role}, what is your biggest challenge?"

Calculated Score Display

Form Variable: score (number, default: 0) Logic Jump Actions: Add points based on answers Thank-you Description: "You scored {score} points! Thanks for completing the quiz."

Conditional Routing with URL Variables

URL: https://nueform.io/f/survey?plan=enterprise

Start Logic Jump:

  • Condition: url:plan equals "enterprise"
  • Destination: Jump to enterprise-specific questions
  • Action: Set plan_name to "Enterprise"

Meilleures pratiques

  1. Use descriptive names: Choose variable names that clearly indicate what they store (e.g., customer_name instead of n).
  2. Set defaults: For form variables, always provide a meaningful default value in case the variable is never modified.
  3. Test with URL parameters: When using URL variables, test your form with various parameter combinations to ensure all paths work correctly.
  4. Handle missing variables gracefully: If a URL variable might not be provided, design your text so it reads naturally even when the variable resolves to an empty string.
Dernière mise à jour : 6 avril 2026