Displaying Data from an Object In A Step
While running a Task, it might be required to populate fields at runtime depending on the user input.
Sample Scenario:
For example, while performing a Battery Inspection, when the BatteryID is selected, the property values pertaining to the selected BatteryID value like Battery Model and Battery Voltage must be populated in the Task at runtime.
The fieldworker can perform the inspection and check whether the information stored in the Object matches with the physical Battery on the shop floor.
If any discrepancies are found, the Object can be updated from the Task.
To display data from an Object in a Step:
Create a Template variable of type Object. Bind the Template variable to the desired Object. Here, a variable BatteryObj is linked to the Battery Object.
Add a Master Data Selector Step to the Template.
Select the Object property to be populated in the Master Data Selector Step. The user will select a value from this list. Here, the BatteryID is displayed in the Step.
Link this Master Data Selector Step to the Object as shown below:
This Step is now linked to the Object. At runtime, the user can select the BatteryID from the list. Whenever the user selects a value from this list, the row pertaining to that value is the current row.
Other properties from that row can be displayed to the user as demonstrated in the following steps.
Create Steps to display the other Object properties to the user.
The datatype of the Step must match the datatype of the Object property.
Two Steps corresponding to the Object properties are created as below:
A Free Step to display the BatteryModel, which is a property of datatype Text.
A Numeric Step to display the property BatteryVoltage, which is a property of datatype Number.
The Steps are linked to the corresponding Object properties.
At runtime, when the user selects a value for BatteryID in the Master Data Selector Step, the other Steps are populated with the property values pertaining to the selected BatteryID.
The user can check the data displayed and update the Object data with new values if required.