var (Read form variable)


The $var function makes it possible to read the content of a previously gesetzten Variablen in forms (e.g. in another element's behaviour).
Hint: Form flags are also variables.

Syntax

$var(varName)

Parameter

Name

Description

varName

The name of the variable

Return value

The value of the variable or null if it is not set or empty.

Example

In the following example, in a behaviour with every 'Change' (1) the content of the text field is written to a variable named 'content' (2).

images/download/attachments/62864048/image2019-12-2_12-0-1-version-1-modificationdate-1610720662817-api-v2.png

When you click on the Read variable... button (3), a Calculate behaviour is executed (4), which reads the variable 'content' and passes it to a Show alert action (5), which displays this value.

images/download/attachments/62864048/image2019-12-2_12-3-57-version-1-modificationdate-1610720662799-api-v2.png

Result:

images/download/attachments/62864048/image2019-12-2_12-6-9-version-1-modificationdate-1610720662787-api-v2.png