In this tutorial we explain how to create, edit, and delete Adobe Captivate variables. One of the easiest tasks you’ll ever perform in Captivate is to create a new user variable. This is just as well, because if you intend to be creating complex interactivity in your e-learning, you’ll definitely be creating lots of variables!
Create a User Variable
- From the Project main menu, select the Variables option.
- When the Variables dialog opens, click the Add New button.
- Type the name of your user variable. I recommend you pause before going to the next steps and finalising the variable name because once you save the variable you cannot later change its name. Check out the recommendations on this page about variable naming.
- Enter a default variable value (if applicable) and provide a Description of its purpose.
- When you are finally happy with the details, click the Save button.
Your newly-created variable will now be listed in the lower part of the Variables dialog. Variables are listed in alphabetical order, with only two exceptions. The user variables called cpQuizInfoStudentID (used for Internal Server Reporting) and cpQuizInfoStudentName (used for capturing the student name variable from a learning management system). For some reason, Adobe has opted to have these variables always sort to the bottom of the list of variables.
Edit a User Variable
Once you’ve created a number of user variables from time to time you’ll need to change something. Since you cannot change the variable’s name, your editing options are limited to altering the default value, description text, or removing/deleting the variable altogether.
- Open the Variables dialog and select the variable you want to change. (The Update button is initially disabled until you make some detectable change to the variable properties.)
- You cannot edit the variable’s name. Edit the Value or Description fields as needed and then click the Update button. (After making the change, the Update button again becomes inactive.)
Remove (Delete) a User Variable
As you develop a project you may find that some of the variables you create become redundant and need to be removed (perhaps because you had to create a duplicate variable with a different name). It’s a good idea to take out the trash by deleting these unwanted variables because they can waste browser memory and slow down run-time performance.
The process is simple enough…but there are some important issues to be aware of:
- Open the Variables dialog and select the variable to be deleted.
- Click the Remove button.
- Now things get a little more complex. Please note the following caveats about removing variables:
- You can only remove user variables, not system variables.
- You can remove a variable referenced by a single action that assigns its value, but this will result in the action being reset to Continue.
- You can only remove user variables that are NOT currently being used to display values in screen objects such as text captions or shapes. Additionally, you cannot remove any variables currently referenced by Standard or Conditional Actions in your project file. If you try to remove one of these referenced variables, Captivate will show the following warning message.
Unfortunately, this warning message doesn’t give you any information about which specific slides or advanced actions use the variable and need to be modified before you can remove it. In a large project with many slides and actions, this can be like trying to find a needle in a digital haystack.
Trace variable usage
Just click the Variables dialog Usage button (similar to the one on the Advanced Actions dialog) to show where the currently selected variable is referenced on any slide in the project, as well as which specific run-time event is used to execute the action involved.
This now makes it extremely easy to do any required project file housekeeping. If your variable is not used anywhere, you’ll just see a dialog simply saying “Item is not currently in use” and you can safely delete it.
However, there appears to be one caveat. Variables that are referenced in widgets don’t get taken into account by the Usage dialog. So if you have a lot of widgets or interactions (which are also widgets) in your project, you may need to check them manually before starting any round of mass deletions.