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:
dataShapes.MeterReading(
{ 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:
Parameter
Description
dataShape.nameOfDataShape
Declares a data shape.
name
Required. Specify the name of a field in the data shape.
baseType
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.
description
Provides a description of the data shape.
ordinal
Specify the order.
aspects
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.