Variable Assignment

Description

Assigns a value to a variable.

Variable assignments differ from Assign Variable actions in two key ways:

  1. They are allowed only at the top level of an experiment. They cannot be declared inside a Protocol or other component.

  2. They are executed when the experiment loads, instead of at run time. The assignment takes place after regular variables are created, but before the creation of selection variables or other components.

In MWEL, top-level assignments are automatically converted into variable assignments.

Signature

variable_assignment

Required Parameters

variable

Variable name

value

Value to assign

Optional Parameters

type

Recommended:

any

Options:
any
boolean
integer
float
string
Default:

string

Controls how the content of value is interpreted. When set to any, the value is parsed like a normal expression, and the parser infers its type.

Placement

Allowed at top level:

Yes