Skip to main content

FieldLogs

Step Value

The Step Value Instructions allows manipulation of the current values of Template Steps. The Step Value category includes four types of Script Instructions:

  1. Get Step Value

  2. Set Step Value

  3. Get Validated Step Value

  4. Validate Step

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.

Get Step Value retrieves the Step value that the user has entered in the UI. This value is not saved into the Task. Set Step Value 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.

Get Validated Step Value gets the value that is saved into the Task. Validate Step sets the value in the UI and saves it into the Task. It is automatically validated and the user need not validate the entry.

Get Step Value is a Step Value Instruction that retrieves the value of the specified Step and stores it in a Local Variable.

To construct a Script Instruction using Get Step Value:

  1. Select Get Step Value from the Instruction dropdown list. Options Variable Name and Step appear as seen below.

    GetStepValue2.png
  2. Enter the name of the Local Variable in the Variable Name field. Choose the Step whose value needs to be retrieved in the Step dropdown list.

    In the below example:

    At runtime, the Local Variable deviceCount holds the value entered by the user in the Step '4 How many devices are connected to the battery?'

    GetStepValue3.png

    The Get Step Value Script Instruction is added to the Script.

    GetStepValue4.png

Set Step Value is a Step Value Instruction that sets the value of the specified Step. It executes a JavaScript expression and sets the result as the current value for a specified Step of the Template.

To construct a Script Instruction using Set Step Value:

  1. Select Set Step Value from the Instruction dropdown list. Options Step and Expression appear as seen below.

    SetStepValue1.png
  2. Choose the Step for which the value needs to be set in the Step dropdown list.

    In the Expression field, enter the JavaScript expression whose result will be set as the value of the selected Step.

    In the below example:

    At runtime, the Set Step Value Instruction sets the value of the Step '4 Battery Voltage Slab' of the Template with the result of the Expression var(enteredVoltage) / 10.

    SetStepValue2.png

The Set Step Value Script Instruction is added to the Script.

SetStepValue3.png

At runtime, if the user enters 550 in Step 3, the following occur:

enteredVoltage = 550

Value of Step 4 is automatically populated with the value 55 ( 550 / 10 ).

SetStepValueRuntime.png

Get Validated Step Value is a Step Value Instruction that retrieves the value of the specified Step after it has been validated and stores it in a Local Variable.

To construct a Script Instruction using Get Validated Step Value:

  1. Select Get Validated Step Value from the Instruction dropdown list. Options Variable Name and Step appear as seen below.

    GetValidatedStepValue1.png
  2. Enter the name of the Local Variable in the Variable Name field. Choose the Step whose value needs to be retrieved in the Step dropdown list.

    In the below example:

    At runtime, the Local Variable batteryID holds the validated value of the Step '1 Enter BatteryID'

    GetValidatedStepValue3.png

The Get Validated Step Value Script Instruction is added to the Script.

GetValidatedStepValue5.png

At runtime, if the user enters 'E123' in Step 1 and validates it, the following occur:

batteryID = 'E123'

The value of Step 3 is set as 'Model: ' + 'E' ( 'E' is extracted from the validated value 'E123')

The user sees the value of Step 3 set as seen below.

GetValidatedStepValue6.png

Validate Step is a Step Value Instruction that validates the specified Step with a value. It executes a JavaScript expression, sets the result as the value for a specified Step of the Template and validates it.

To construct a Script Instruction using Validate Step:

  1. Select Validate Step from the Instruction dropdown list. Options Step and Expression appear as seen below.

    ValidateStep1.png
  2. Choose the Step whose value needs to be validated in the Step dropdown list.

    In the Expression field, enter the JavaScript expression whose result will be set as the value of the Step to be validated.

    ValidateStep2.png

    In the example:

    At runtime, the Validate Step Instruction sets the value of the Yes/No Step '5 Is this a replaceable model?' of the Template with the result of 1 causing the Yes/No Step to take a value of 'Yes'.

    Note

    Yes = 1 and No = 0 for a Yes/No Step

    The Validate Step Script Instruction is added to the Script.

    ValidateStep3.png

    This Script Instruction is set to execute after Step 4 Enter the inventory ID of the Template is validated. If the user enters an inventory ID, it implies that the battery is replaceable. Hence, the Script sets a value of 1 to Yes/No Step 5 and validates it.

    ValidateStep4.png
    ValidateStep5.png