ThingWorx WebSocket-based Edge MicroServer (WS EMS) and Lua Script Resource (LSR) > Configuring a Template for the Lua Script Resource > Configuring Data Shapes
Configuring Data Shapes
The dataShapes group is used to define data shapes that describe the structure of an infotable.
Data shapes that are declared can be used as input or output for services. In addition, you can use data shapes to generate strongly typed data structures.
Each data shape is defined using a series of tables, with each table representing a field within the data shape. These fields must have a name and base type, but may also include other parameters. For example:
{ name = "Temp", baseType = "INTEGER" },
{ name = "Amps", baseType = "NUMBER" },
{ name = "Status", baseType = "STRING", aspects = {defaultValue="Unknown"} },
{ name = "Readout", baseType = "TEXT" },
{ name = "Location", baseType = "LOCATION" }
The following table lists and describes these parameters:
Declares a data shape.
Required. Specify the name of a field in the data shape.
Required. Specify the WS EMS base type of the field in the data shape. For a list of base types, refer to ThingWorx Base Types.
Provides a description of the data shape.
Specify the order.
Specify a table that can provide additional information, such as a default value, or a data shape if the base type of the field is INFOTABLE.