Dynamic variables

In the Riddle Creator you can use dynamic variables to personalize / dynamically display any Riddle / form data.

You can do the same when building a Riddle via the API - all title and description properties can be personalized with dynamic variables.

Syntax

The following syntax is used to embed dynamic variables into a property:

%riddleVariable

Example:

Welcome back, %name!

riddleVariable then needs to be replaced with the variable you want to use. Keep reading to learn which variables you can use.

Dynamic Riddle variables

Available variables

Riddle typeVariableDescription
Allriddle.idThe unique ID of the Riddle
Allriddle.titleThe title of the Riddle
Allriddle.imageThe image of the Riddle - this will be automatically translated to an image in the email automation / DOI
Quizresult.titleThe title of the user result
Quizresult.descriptionThe description of the user result
Quizscore.numberThe score of the user as a number
Quizscore.percentageThe score of the user as a percentage
Quizscore.maxThe maximum achievable score the user could have achieved

Example

You could personalize the result page by using the variables result.title, score.number, and score.max:

{
    "result": {
        "title": "Your result: %result.title",
        "description": "You scored %score.number out of %score.max"
    }
}

Dynamic form variables

Added form fields can be used in any following blocks as dynamic variables.

For example, adding a a FormBuilder with two Name fields and one Email field makes the following variables available:

  • %name (this will always be the first Name field)
  • %name1
  • %name2
  • %email (this will always be the first Email field)
  • %email1

Here's how you could integrate the variables into a SingleChoice quiz question:

{
    "title": "What's the capital of Germany, %name1 %name2?",
    "type": "SingleChoice",
    "items": {
        "Berlin": true,
        "Lissabon": false,
        "Leipzig": false
    }
}