Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Overview

A variable is a container for storing values that can be set statically or dinamically. One the key characteristics of a variable is that is subject to change during the life of an app.
Variables have names so the value in it can be referenced in one or multiple places easily. Let's see how to use it.

For this exercise we need to have a Project with at least one Page. Let’s continue using “HR App”.

How to declare a “Variable” in a page?

The first thing we need to do for using a variable is declare it. To do that let’s go to our HR Sample APP” project and open “Add Employee Form” Page.

...

Now we can see the new variable displayed under “Variables” tab:

...

How to use a variable?

We can reference variables using the ampersand (&) symbol at the left of a variable name.

...

Last, let’s click “Preview” to see it working.

...

Recap

Variables are a powerful feature that can be used almost anywhere to give your app a dynamic behavior by keeping states, controlling logical flows or sending them as parameters.
We will be seeing many more examples of variables in the rest of Control’s Unit.