Skip to main content

FieldLogs

Step Value

The Step Value Instructions retrieve/set the current values of Task Steps.

This category includes six types of FieldLogs specific Instructions:

  1. Flkw:GetValueOfStep

  2. Flkw:SetValueOfStep

  3. Flkw:GetValidatedValueOfStep

  4. Flkw:ValidateStepWithValue

  5. Flkw:GetStepValueFromExecPath

  6. Flkw:ValidateStepWithValueFromExecPath

Note

Step Value refers to the value that is entered in the UI. This is not yet saved into the Task.

Validated Step Value refers to the value of of the Step that is saved into the Task.

Flkw:GetValueOfStep retrieves the Step value that the user has entered in the UI. This value is not saved into the Task. 

Flkw:SetValueOfStep sets the Step value in the UI as if the user just input it. This value is not yet saved into the Task. The user still needs to validate the entry in order to save the value into the Task.

Flkw:GetValidatedValueOfStep gets the value that is saved into the Task. 

Flkw:ValidateStepWithValue sets the value in the UI and saves it into the Task. It is automatically validated and the user is not required to validate the entry.

Flkw:GetStepValueFromExecPath retrieves the Step value that the user has entered in the UI using the Execution Path provided.

Flkw:ValidateStepWithValueFromExecPath sets the Step value in the UI and saves it into the Task using the Execution Path provided. It is automatically validated and the user is not required to validate the entry.

Important

Step ID may be different from the Step number displayed in the UI. Generally, Step numbers are displayed when a Template is opened.

ShowStepID1.png

Click Show Step ID to see the Step IDs. The Step IDs are displayed as seen below.

ShowStepID2.png

Use these Step IDs in Scripts.

Note that the Step IDs are underlined and in italics ( 4, 5, 6 ) unlike Step numbers ( 1, 2, 3 ).

Flkw:GetValueOfStep retrieves the value of the specified Step.

Format:  Flkw:GetValueOfStep('Step ID');

Parameter

Description

Step ID

The ID of the Step whose value is to be retrieved.

To construct a Script Instruction using Flkw:GetValueOfStep:

  • Select JS Execute from the Instruction dropdown list. In the Expression field, enter the Flkw:GetValueOfStep Instruction as shown.

    GetStepValue1.png

A Flkw:GetValueOfStep Script Instruction is added to the Script .

In the example, the value is stored in a Local Variable and used in the Script.

Flkw:SetValueOfStep sets the value of the specified Step.

Format: Flkw:SetValueOfStep('Step ID','Value');

Parameter

Description

Step Id

The ID of the Step whose value is to be set.

Value

The value to be set.

To construct a Script Instruction using Flkw:SetValueOfStep:

  • Select JS Execute from the Instruction dropdown list. In the Expression field, enter the Flkw:SetValueOfStep Instruction as shown.

    SetValueOfStep1.png

    This Script is added to the Step that will cause the action to be triggered after it is validated.

A Flkw:SetValueOfStep Script Instruction is added to the Script as shown above.

At runtime, let us suppose that the user enters 4400 as the Battery Mains Voltage and 8 as the Number of Equipments.

SetValueOfStep3.png

The Script does the following:

battVoltage= 4400

noEquipments = 8

voltagePerDevice = 4400 / 8 = 550

The Flkw:SetValueOfStep sets the value of 550 to the Step 3 ( Step ID 7 ).

SetValueOfStep4.png

Note that the value is not validated by the Script. The user is required to validate it.

Flkw:GetValidatedValueOfStep retrieves the validated value of a given Step of the Template and stores it in a Local Variable.

Format: Flkw:GetValidatedValueofStep ( 'Step ID' );

Parameter

Description

Step ID

The ID of the Step whose validated value is to be retrieved.

To construct a Script Instruction using Flkw:GetValidatedValueofStep:

  • Select JS Execute from the Instruction dropdown list. In the Expression field, enter the Flkw:GetValidatedValueofStep Instruction as shown.

    GetValidatedValueOfStep1.png

A Flkw:GetValidatedValueofStep Script Instruction is added to the Script.

In the example above, the values are stored in Local Variables and used in the Script.

Flkw:ValidateStepWithValue is a Step Value Instruction that sets the validated value of a specified Step.

Format: Flkw:ValidateStepWithValue('Step ID','Value');

Parameter

Description

Step ID

The ID of the Step whose validated value is to be set.

Value

The value to be set.

To construct a Script Instruction using Flkw:ValidateStepWithValue:

  • Select JS Execute from the Instruction dropdown list. In the Expression field, enter the Flkw:ValidateStepWithValue Instruction as shown.

    SetValidatedValueOfStep.png

A Flkw:ValidateStepWithValue Script Instruction is added to the Script as shown above.

At runtime, let us suppose that the user enters 4400 as the Battery Mains Voltage and 8 as the Number of Equipments.

SetValueOfStep3.png

The Script does the following:

battVoltage = 4400

noEquipments = 8

voltagePerDevice = 4400 / 8 = 550

The Flkw:ValidateStepWithValue sets the value of 550 to the Step 3 ( Step ID 7 ).

It is important to associate this Script with the last step that will be validated. This will ensure that the user has filled in all the data that the Script requires to perform the desired action.

ValidateStepWithValue2.png

Note the value is already validated by the Script. The user is not required to validate it.

Flkw:GetStepValueFromExecPath  retrieves the value of the specified Step when the execution path is provided.

Note

Values of steps inside components can also be retrieved.

Format: Flkw:GetStepValueFromExecPath('Step Execution Path');

Parameter

Description

Step Execution Path

The Execution Path of the Step.

For example, a Step Execution Path value of “2,6,1,8” points to the step id 8, and it is located as follows:

August2024-Authoring.png

To construct a Script Instruction using Flkw:GetStepValueFromExecPath:

  • Select JS Execute from the Instruction dropdown list. In the Expression field, enter the Flkw:GetStepValueFromExecPath Instruction as shown.

    GetStepValueFromExecPath-Script.png

    A Flkw:GetStepValueFromExecPath Script Instruction is added to the Script as shown above.

    In the example, the Execution Path value of 7,3,9,5 points to the Step of ID (5). At runtime, after the validation of Step 1.1.1.1, the value is displayed as an alert.

    GetStepValueFromExecPath-Value.png
    GetStepValueFromExecPath-Alert.png

    Note

    Values of steps inside components can also be retrieved.

Flkw:ValidateStepWithValueFromExecPath is a Step Value Instruction that sets the validated value of a specified Step to a Step in a component or a Step when the execution path is provided.

Format: Flkw:ValidateStepWithValueFromExcePath('Step Execution Path','Value');

Parameter

Description

Step Execution Path

The Execution Path of the Step.

For example, a Step Execution Path value of “2,6,1,8” points to the step id 8, and it is located as follows:

August2024-Authoring.png

Value

The value to be set.

To construct a Script Instruction using Flkw:ValidateStepWithValueFromExecPath:

  • Select JS Execute from the Instruction dropdown list. In the Expression field, enter the Flkw:ValidateStepWithValueFromExecPath Instruction as shown.

    ValidateStepWithValueFromExecPath-Script.png

    A Flkw:ValidateStepWithValueFromExecPath Script Instruction is added to the Script as shown above.

    In the example, the Execution Path value of 7,3,9,4 points to the Step of ID (4). The value of Step of ID (4) is stored in the variable 'val'.

    The Execution Path value of 7,3,9,10,5 points to the Step of ID (5) to be validated.

    At runtime, after the validation of Step 1.1.1.2, the Step 1.1.1.4 is validated with the value 240 as shown below..

    ValidateStepWithValueFromExecPath-Value.png