Enterprise Object Data
The Enterprise Object Data Instructions allow manipulation of Object data.
This category includes five Fieldlogs Specific Script Instructions:
Flkw:GetObjectValue
Flkw:SetObjectValue
Flkw:DefineObject
Flkw:BindObject
Flkw:SelectObjects
Important
In order to use these functions, the Template variables of type Object must be created and available at runtime. To know more about Template variables, click here.
These Instructions manipulate the value of the selected Properties of the selected Object inside those objectModel variables.
Flkw:GetObjectValue
retrieves the value of a property in an Object variable.
Format: Flkw:GetObjectValue( 'Object Variable.property name');
Parameters | Description |
---|---|
Object variable.property name | The name of the Object variable and the name of the property whose value is to be retrieved. |
To construct an enhanced Script Instruction using Flkw:GetObjectValue
:
Select
JS Execute
from the Instruction dropdown list. In theExpression
field, enter theFlkw:GetObjectValue
Instruction as shown.
The Flkw:GetObjectValue
Instruction is added to the Script.
![]() |
At runtime, the Script gets the value of the property in the Object variable and stores it in a Local Variable. The Script displays the values as shown below.
![]() |
Flkw:SetObjectValue
sets the value of a property in an Object variable.
Format: Flkw:SetObjectValue('Object variable.property name','Value');
Parameters | Description |
---|---|
Object variable.property name | The name of the Object variable and the name of the property whose value is to be set. |
Value | The value to be set. |
To construct an enhanced Script Instruction using Flkw:SetObjectValue
:
Select
from the dropdown list. In the field, enter theFlkw:SetObjectValue
Instruction as shown.
The Flkw:SetObjectValue
Instruction is added to the Script.
At runtime, the initial value (1200) of the property (BatteryVoltage) of the Object Variable(BatteryObj) is displayed in Step 3.
![]() |
The Script sets the new value (9900) to the property (BatteryVoltage) of the Object Variable(BatteryObj) . Immediately, the new value is displayed in Step 3 as shown below.
![]() |
Flkw:DefineObject
creates a variable to hold an instance of an Object, so that it can be used in the Script.
These variables are used when the Script requires a local Object Variable to hold values and manipulate them. These variables will not be visible anywhere else in the Template, unlike Template Variables.
Format: Flkw:DefineObject('Variable Name','Description','Object Name');
Parameters | Description |
---|---|
Variable Name | The name of the variable. |
Description | The description of the variable |
Object Name | The name of the Object whose instance is held by the variable |
To construct an enhanced Script Instruction using Flkw:DefineObject
:
Select
from the dropdown list. In the field, enter theFlkw:DefineObject
Instruction as shown.
The Flkw:DefineObject
Instruction is added to the Script. The user enters a BatteryID.
![]() |
This is assigned to the property (BatteryID) of the local Object Variable within the Script and displayed as shown below.
![]() |
Flkw:BindObject
binds the content of a JavaScript object to a Template Variable.
For example, a JSON stream containing data or a response from an external call can be parsed into a JavaScript Object. Then, using Flkw:BindObject, you can bind the JavaScript Object to a Template variable for further use in the Template execution.
Format:Flkw:BindObject('window.Objectname','Template variable name');
Parameters | Description |
---|---|
window.Objectname | The name of the Object NoteThe Object should always be named as window.Objectname to ensure that changes to any properties of the object are reflected |
Template variable name | The name of the template variable to bind to the defined Object. This can either be a Template variable or an Object variable defined by |
To construct an enhanced Script Instruction using Flkw:BindObject
:
Select
from the dropdown list. In the field, enter theFlkw:BindObject
Instruction as shown.
The Flkw:BindObject
Instruction is added to the Script.
Flkw:SelectObjects
returns the rows from an Object that satisfy the query.
Format: Flkw:SelectObjects('Object name', 'Property query');
Parameters | Description |
---|---|
Object name | The name of the Object that contains the value that you want to display. |
Property query | The basic 'Select' query that specifies conditions to select a subset of the Object. The property query may consist of one or more conditions. Conditions can be combined with logical operators ( && and ||) and grouping (parenthesis). The format of the Property query is: " .property name operators (==,<,>) property value" For example: " .BatteryID == 'A124' " |
To construct an enhanced Script Instruction using Flkw:SelectObjects
:
Select
JS Execute
from the dropdown list. In the field, enter theFlkw:SelectObjects
Instruction as shown.
The Flkw:SelectObjects
Instruction queries the Object and returns the rows corresponding to the condition BatteryID == 'A124' as a list. The Script then extracts the required BatteryVoltage value and displays it as shown below.
![]() |