User Guide Cancel

Variables in Adobe Captivate

In the all-new Adobe Captivate, a variable stores information in a project. This article introduces and explains variables in Adobe Captivate, the different types of variables, inserting, naming, and using variables.

What are variables

Like all programming languages, Adobe Captivate uses variables to store values. You can use variables while designing interactions, displaying a learner’s name on a certificate, or even using them to calculate assessment scores. In other words, you can use variables to track a learner’s progress, assessment, navigation, and more.

Types of variables

There are two types of variables in Adobe Captivate- System and User.

System variables

System variables are pre-defined variables in Captivate. You cannot create a system variable or change the name of a system variable. System variables are read-only.

The following are examples of a system variable:

  • Date.DateDDMMYY is a system variable that returns the date in dd/mm/yyyy format.
  • Quiz.Score returns the number of points that are scored in a quiz.

User variables

User variables are variables you can create and name as you like. The name you assign to a user variable must not conflict with Adobe Captivate’s internal functions, reserved keywords, exposed system variables, or other hidden variables.

List of variables

Variable data types in Adobe Captivate

Adobe Captivate supports three data types for variables.

  1. Number: The Number variable stores numeric values. Number data types are commonly used in reporting quiz scores, tracking user progress, mathematical operations, or gamification.
  2. True or False: True or False or Boolean variables contain a true or false value. Use this variable type to create conditional interaction logic, track user choice, or branching.
  3. String: The String variable stores text values. String variables store characters, such as words or sentences. Use this variable type to capture text-based input, display feedback messages, or hold locale-based content.

Create a variable

In this example, you’ll create a variable text_001 that stores your name. You’ll also add a description to the variable.

  1. Select Project properties in the right toolbar.

  2. Click the Create a variable (+icon in the Variables section.

    Create a variable
    Select the + icon to create a variable.

  3. In the Variables dialog, type text_001 in the Name field.

    Adding text in the variable dialog
    Create a text variable

  4. Select String in the Type dropdown.

  5. Type your name in the Value field.

    Adding your name in value
    Enter the value of the variable

  6. Type the variable’s description in the Description field.

  7. Click Create.

After creating the variable, you can view the variable in the list of variables.

View your variable in the variable list
View the variable in the list.

Edit a variable

You can change the name, value, and description of an existing variable. In this example, you’ll edit the variable you created in the previous section.

  1. Select Project properties in the right toolbar.

  2. Click the gear icon in the Variables section.

  3. In the list of variables, navigate and select the variable you want to edit.

    Select variable to edit
    Edit the variable

  4. Double-click the variable and change its name.

    Double-click variable to type
    Change the name of the variable

  5. Repeat the earlier step for the Value and Description fields.

    Adding description to the variable
    Add variable description

  6. After making the changes, click anywhere outside the dialog to save your changes.

Delete a variable

In this example, you’ll delete the variable you changed in the previous section.

  1. Select Project properties in the right toolbar.

  2. Click the gear icon in the Variables section.

  3. In the list of variables, select the variable you want to delete.

    Select variable to delete
    Select the variable to delete.

  4. Select the trash icon.

    Selecting trash icon
    Select the trash icon to delete the variable.

    Note:

    You can delete multiple variables at the same time by selecting the variables and clicking the trash icon.

Copy and paste a variable

In this example, you’ll create a variable, num_001. Then you’ll copy this variable and paste it.

  1. Create the variable num_001 of type Number. View the section Create a Variable to learn about creating a variable.

  2. In the list of variables, select the variable.

    Select variable to copy
    Select the variable

  3. Select the copy icon. There’ll be a confirmation message that the variable is copied.

  4. Select the paste icon.

A new variable is created and added to the list of variables. The copied variable has _1 appended to its name. The copied variable retains the same value and description as its source variable.

New variable is created
List of variables

Search a variable

In this example, you’ll search for the variable that you’ve created.

  1. Select Project properties in the right toolbar.

  2. Click the gear icon in the Variables section.

  3. In the Variables dialog, select the search icon.

  4. Type the name of the variable you want to search. The matching variables are displayed in the list.

    Type variable's name to search
    Search for variables

The search returns variables in the User and System tabs. Select the respective tab to view the variable.

Use a variable in a project

Now that you’ve created a variable, it's time to use this variable in a project. You’ll insert the variable inside a text block. When you preview the project, the variable value is displayed at runtime.

  1. Select Add text blocks > Paragraph in the left toolbar.

  2. Edit the text in the text block. To learn more about editing text in Adobe Captivate, view Add text in Adobe Captivate.

    Editing text
    Add text in a text block

  3. In the text block, type $$ and select the variable from the list

    Typing $$ to select the variable
    Select variable in the list

    The variable is enclosed with $$ at both ends.

    Enclosing the variable

    When you’ll preview the project, the value assigned to the variable is displayed.

    Previewing the project
    Value of the variable displays

Actions on variables

Adobe Captivate lets you add interactions to objects using variable-based actions. The following actions are available in the Action panel in Interactions.

To learn more about creating interactions in Captivate, view Create interactions in Adobe Captivate.

Get help faster and easier

New user?