Store and Pass Data with Variables

Learn to store values in variables and carry data from page to page.

Video


Variables Video (2:40 min)

Variables Overview

Variables are used to store and pass information from page to page as you click through the prototype. Variable values are set using interactions.

There are many uses for variables. Any time you want to save information from one page and use it on another page, variables will be used. Variable values can be used in conditions (discussed below) or used when setting the text on widgets (Dynamically setting widget values).

There is no limit to the number of variables you can use. However, if prototypes are to be viewed in Internet Explorer, we recommend using fewer than 25.

Manage Variables

Select Wireframe->Manage Variables in the main menu to create, remove, rename and reorder variables in the Manage Variables dialog. By default, the OnLoadVariable is created in every file. Variable names must be alphanumeric, less than 25 characters, and contain no spaces.

The Manage Variables dialog can also be accessed when building conditions or an interaction to set values on variables.

Set Variable Values

Add an interaction and use the “Set Variable and Widget value(s) equal to Value(s)” action. Then, click on the “Variable and Widget value equal to Value” link in the Actions description to open the Set Variable and Widget Values dialog.

In this dialog, you can construct actions that set variable values (see Dynamically set widget values to learn more). A variable can be set to a variety of types of values:

    Value: A text value you enter

    Value of variable: The value stored in another variable

    Length of variable value: The numerical character length of another variable value

    Selected option of: The selected option of a droplist or list box

    Is checked of: “true” or “false” based on whether a radio button or checkbox is checked

    Text on widget: The text entered on a form widget (Text Field or Text Area). Note that variable values cannot be set to the text on rich text formatted widgets (Buttons Shapes, Text Panels).

    Length of widget value: The numerical character length of a widget value

An example of an action you might create is: “Set value of variable NameVariable equal to text on widget NameField”. This action will store the value entered in the text field “NameField” in the variable “NameVariable”.

Using Variables in Conditions

As described in Using Conditional Logic, you can define conditions based on variable values. These conditions are defined in the Condition Builder dialog.

Below is an example where conditions have been defined on two cases for the variable NameVariable, and the appropriate dynamic panel state is set accordingly.

Summary

Need to pass data from one page to another? Now you can. Still not sure how this works? Email us at support@axure.com and we will help you figure it out.

View All Master Level Articles Dynamically Set Widget Values