Global Value
The Global Value Instructions allow manipulation of the values of Global Variables and Template Variables.
Note
Global Variables are named values that are shared between different Scripts.
Local Variables are local to the Script/Block they are defined in.
Template Variables are named values accessible across the entire Template.
The Global Value category includes four types of Script Instructions:
Get Global Value
Set Global Value
Get Template Variable Value
Set Template Variable Value
is a Global Value Instruction that retrieves the value of a Global Variable and stores it in a Local Variable.
To construct a Script Instruction using
:Select
from the dropdown list. Options and appear as seen below.Enter the name of a Local Variable in the
field. Choose the Global Variable whose value needs to be retrieved from the dropdown list.In the below example:
At runtime, the value of the Global Variable VoltageSlabDenominator is retrieved and stored in the Local Variable vsDenominator.
The
Script Instruction is added to the Script.
is a Global Value Instruction that sets the value of a Global Variable. It executes a JavaScript expression and sets the result as the value of the Global Variable.
To construct a Script Instruction using
:Select
from the dropdown list. Options and appear as seen below.In the
field, enter the name of the Global Variable that would store the result of the Expression.In the
field, enter the JavaScript expression whose result needs to be set as the value of the Global Variable.In the below example:
At runtime, the Global Variable VoltageSlabDenominator is created and it holds the value 10.
The
Script Instruction is added to the Script.
is a Global Value Instruction that retrieves the value of a Template Variable and stores the value in a Local Variable.
To construct a Script Instruction using
:Select
from the dropdown list. Options and appear as seen below.Enter the name of the Local Variable in the
field. Choose the Template Variable whose value needs to be retrieved from the dropdown list.In the below example:
At runtime, the value of the Template Variable DefaultVoltage is retrieved and stored in the Local Variable tempVoltage
The
Script Instruction is added to the Script.![]() |
is a Global Value Instruction that sets the value of a Template Variable. It executes a JavaScript expression and sets the result as the value of the Template Variable.
To construct a Script Instruction using
Step:Select
from the Instruction dropdown list. Options and appear as seen below.Choose the Template Variable whose value needs to be set in the
dropdown list.In the
field, enter the JavaScript expression whose result needs to be stored in the Template Variable.In the example:
At runtime, the Set Template Variable Value Instruction sets the value of the Template Variable EnteredBatteryVoltage with the result of the expression var(enteredVoltage) - 10
The
Script Instruction is added to the Script.