User Guide Cancel

Variables in Adobe Captivate

  1. Captivate User Guide
  2. Introduction to Captivate
    1. What's New in Adobe Captivate
    2. Adobe Captivate System Requirements
    3. Adobe Captivate Updates
      1. Adobe Captivate (12.3 update) release notes
      2. Adobe Captivate (12.2 update) release notes
      3. Adobe Captivate (12.1 update) release notes
    4. Download Adobe Captivate
    5. Frequently Asked Questions
  3. Add a slide
    1. Slide navigator in Adobe Captivate
    2. Add a conversation slide
    3. Add characters to your Adobe Captivate project
    4. Edit the background image on a slide
    5. Create a long scroll project
  4. Add text blocks
    1. Add text to a project
  5. Add media blocks
    1. Add images to a project
    2. Add videos to a project
    3. Add quotes
    4. Add SVGs to a project
  6. Interactive components
    1. Add a button
    2. Add an input field
    3. Add a radio button group
    4. Add a dropdown
    5. Add a checkbox
  7. Widgets
    1. Add a Card
    2. Add Tabs
    3. Add a Certificate
    4. Add a Carousel
    5. Add a Hotspot
    6. Add Drag-and-Drop
    7. Add a Timeline
    8. Add Click to Reveal
  8. Create quizzes
    1. Add a Multiple-choice question
    2. Add a True or false question
    3. Add a Match the column question
    4. Add a Short answer question
    5. Add a Sequence question
    6. Import questions as CSV
  9. Add audio to a project
    1. Add audio
  10. Interactions
    1. Add interactions to a project
    2. Create interactive video with overlay
    3. Create a slide-level interaction
    4. Create an object-level interaction
  11. Animations
    1. Add animations to a project
  12. Accessibility
    1. Make a project accessible
  13. Customize the timeline
    1. Timeline panel in Adobe Captivate
  14. Customize TOC and Playbar
    1. Table of Contents in Adobe Captivate
  15. Edit project properties
    1. Variables in Adobe Captivate
    2. Preferences
    3. Themes
  16. Preview a project
    1. Preview
  17. Share a project for review
    1. Share for review   
  18. Publish a project
    1. Publish your project
  19. Create a simulation project
    1. Simulation

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

The table displays the user variables in Adobe Captivate.

Variable name

Description

LMS.CourseName

Get the name of the course from the LMS.

LMS.LearnerName

Get the name of the learner from the LMS.

LMS.LearnerID

Get the ID of the learner from the LMS.

System variables in Adobe Captivate are grouped according to functionalities.

Project information

Variable name

Default value

Description

Project.AudioLevel

100

Increase or decrease the volume. Set a value between zero (mute) to 100 (maximum).

Project.ClosedCaptions

True

Displays or hides closed captions in a project.

Project.CurrentSlideName

slide

Returns the name of the current slide.

Project.CurrentSlideNumber

1

Returns the current slide number.

Project.LockTOC

False

Enables or disables user interaction with the TOC. Set the value to True to disable user interaction.

Project.MuteAudio

False

Mutes or unmutes the audio. Set the value to True to mute the audio.

Project.ShowPlaybar

True

Displays or hides the Playbar in a published project. Set the value to True to display the Playbar.
Project.ShowTOC
False Displays or hides the TOC. Set the value to True to show the TOC.

Project.SlideCount

1

Returns the number of slides in the project.

Quizzing

Variable Name Default value Description

Question.AnswerChoice

 

Returns the answer to a question.

Question.MaxAttempts

0

Returns the maximum number of attempts allowed for the current question.
Question.NegativePoints
0 Return the negative marks assigned to the question in the current slide.
Question.PointsAssigned
0 Return the number of points set for the question in the current slide.

Question.PreviousQuestionScore

0

Returns the points a user scored in the last visited question slide.

Quiz.AttemptCount

0

Returns the number of times a user has attempted the quiz.

Quiz.CorrectAnswerCount

0

Returns the number of correctly answered questions.

Quiz.InReview

False

Indicates if a learner is in a quiz review mode. A True value indicates that a learner is in the quiz review mode.

Quiz.InScope

False

Indicates if a learner is within the scope of a quiz in the course.

Quiz.MaxScore

0

Returns the maximum score of the quiz.

Quiz.Pass

False

Returns the result of the quiz- Pass or Fail.

Quiz.PassPercentage

0

Returns the pass percentage of the quiz as

specified while creating the quiz.

Quiz.PassPoints

0

Returns the points to pass the quiz.

Quiz.PercentageScore

0

Returns the score of the quiz as a percentage.

Quiz.QuestionCount
0 Returns the number of questions in the project.
Quiz.Score
0 Returns the number of points a learner has scored in the project.
Quiz.UnansweredQuestionCount
0 Returns the number of unanswered questions in the project.

System information

Variable name

Default value

Description

Date.DateDDMMYY

dd/mm/yyyy

Returns the current date in the dd/mm/yyyy format.

Date.DateMMDDYY

mm/dd/yyyy

Returns the current date in the mm/dd/yyyy format.

Date.Day

1

Returns a number indicating the day of the week. For example, the variable returns 1 for Sunday, 2 for Monday, etc.

Date.Hours

hh

Returns the current hour set in your computer in a 24-hr format.

Date.LocaleString

 

Returns the current date based on your computer's locale settings.

Date.Minutes

mm

Returns the current minutes set on your computer.

Date.Month

mm

Returns the current month set on your computer. The variable returns 1 for January, 2 for February, and so on.

Date.Time

hh:mm:ss

Returns the current time in the hh:mm:ss format.

Date.Today

dd

Returns the current day set on your computer. If the current date is 15 Dec 2023, the variable returns 15.

Date.Year

yyyy

Returns the current year set on your computer. If the current date is 15 Dec 2023, the variable returns 2023.

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.

Switch the value of a variable. This action is used in cases where you need to toggle between states of an object. In this example, you’ll add the Toggle variable action to a button. When a user clicks the button, the pose of a character changes.

  1. Select Add media blocks > Single Character in the left toolbar.

  2. In the Components section of the Visual Properties panel, remove the Title, Body, and Card.

    Removing the title, body, and card
    Add a character

  3. Select the character in the content block.

  4. Using the image placeholder icon, add a character from Assets.

  5. Select the character Angela.

    Selecting the character
    Add character from Assets

  6. Select the poses.

    Selecting the poses

  7. Click Replace Poses.

  8. In the Visual Properties panel, click View to launch the States flyout. Both poses become the states of the character. For more information, States in Adobe Captivate.

    Launching the states flyout
    Launch the states flyout

  9. Select the button and change its label to Change Pose. For more information on adding buttons, Add a button in Adobe Captivate.

    Changing the label
    Change button label

  10. Select Project properties in the right toolbar.

  11. Select the gear icon in the Variables section to launch the Variables dialog.

  12. Create a variable toggle_control of type True/False with the default value of False. View the Create a variable section to learn more about creating a variable.

  13. Click anywhere outside to exit the variable dialog to exit the Variables dialog.

  14. Select the button in the content block.

  15. Select Interactions in the right toolbar.

  16. Click + in Conditions.

  17. Select Variable.

  18. In the User tab, select the variable toggle_control.

  19. With the dropdown option set to Is Equal To, select A value.

  20. Select False.

    Selecting vale as false
    Select False

  21. Click Save.

  22. In the User tab, select the variable toggle_control and click Done.

  23. In the Action section, select More > Toggle variable.

  24. Click + Add new action.

  25. In the Action section, select Set state.

  26. Select the character and then select Pose 2.

  27. Click Next.

  28. Click Done.

  29. Select the Else tab and click + Add new action.

  30. In the Action section, select More > Toggle variable.

  31. Select the variable toggle_control.

  32. Click Done.

  33. Click + Add new action.

  34. In the Action section, select Set state.

  35. Select the character and then select Pose 1.

  36. Click Next.

  37. Click Done.

When a learner clicks the button, on each click, the character toggles between the states.

Change the value of a variable. You can add, subtract, multiply, or divide a value to an already-created variable. In this example, you’ll create a question-answer scenario where a learner enters a response in an input field. If the response is correct, the score is set to 1. If the response is incorrect, the score is set to -1.

  1. Select Add interactive components > Input Field in the left toolbar. To know more about working with the input field, view Add Input Field in Adobe Captivate.

  2. In the Visual Properties panel, apply a design option.

  3. In the Components section, remove the button component.

  4. Select Add text blocks > Paragraph.

  5. Select Project properties in the right toolbar.

  6. Select the gear icon in the Variables section to launch the Variables dialog.

  7. Create a variable points of type Number with the default value of 0. View the Create a variable section to learn more about creating a variable.

  8. Click anywhere out to exit the Variables dialog.

  9. Select the text in the paragraph content block. Select the Visual Properties panel in the right toolbar to change the properties of the paragraph text. For more information on changing text properties, view Text in Adobe Captivate.

  10. Use the variable points in the text. To know more about using a variable in a project, view the section Use a variable in a project

    Using variable points
    Use the variable

  11. Select the input field.

    Selecting input field
    Select the input field

  12. In the Settings section of the Visual Properties panel, click Add answers, and add the correct answer.

    Adding the correct answer
    Add the correct answer

  13. Click Save.

  14. Select Interactions in the right toolbar.

  15. In the Focus lost tab, select Valid input entered to create the workflow when the learner enters the correct answer.

    Selecting valid input entered
    Add validation for the answer

  16. In the Action section, select More > Adjust variable.

  17. In the User tab, select the variable points.

  18. In the Operation selector, select +, and enter 1 in the Enter value field.

    Operating the variable points
    Adjust variable for correct answer

  19. Click Done.

  20. In the Focus lost tab, select Invalid input entered to create the workflow when the learner enters the incorrect answer.

  21. In the Action section, select More > Adjust variable.

  22. In the User tab, select the variable points.

  23. In the Operation selector, select -, and enter 1 in the Enter value field.

    Operating the variable points
    Adjust variable for incorrect answer

  24. Click Done. The interaction is now complete.

    Completed adding variable points
    List of the interactions

Preview the project. When learners enter the correct answer, Paris, they get one point. When they enter any other answer, they get –1.

Assign a value to a variable. You can assign the value of another variable, an element's content, or the value of any expression to an existing variable. View the Create a guided interaction using radio buttons article for an example of adding interaction to a button so that action occurs when a learner selects the correct option in a radio group and clicks a button.

 Adobe

Get help faster and easier

New user?

Adobe MAX 2024

Adobe MAX
The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX

The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX 2024

Adobe MAX
The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX

The Creativity Conference

Oct 14–16 Miami Beach and online