ThingWorx Edge Java SDK > Application Details > Infotables
Services have arguments and return values that are expressed using primitives such as String, Integer, Number, and Boolean. A set of service arguments are described by an infotable. It may help to think of an infotable as a "spreadsheet", in which each column has a primitive type and the may be many rows. Service parameters and return values are passed an received as infotables with a single row. The Java SDK has tools for constructing infotables that are needed for invoking services.
In the ThingWorx environment, an infotable is an aggregate base type within the ThingWorx platform and Edge products. An infotable has a DataShapeDefinition that describes the names, base types, and additional information about each field within the table. Data within an infotable is contained in rows. Each row can have one or more fields, described by the DataShapeDefinition of the infotable. Here is an example of an infotable definition, with its data shape and rows:
In addition to using infotables with services, you can use infotables to hold data for an event or the values that are returned by a read request for multiple properties. The infotable can contain one or more rows. When results are returned, you need to extract the values from each row, using the methods, getFirstRow(), getSecondRow(), and so on. You also use a helper function that matches the base type for the field, such as getStringValue().
A DataShapeDefinition is required for each infotable. Refer to the section, DataShapes, for details.
Here is an example of using an infotable to return the results of a property read, extracted from the sample source file,
// Define result as an InfoTable
InfoTable result

// Reading the "name" property of a Thing and
// extracting the results from an InfoTable
// Since "name" is a STRING, use getStringValue()
// to return the value of the "name" property.
result = client.readProperty(ThingworxEntityTypes.Things,
ThingName, "name", 10000);
String name = result.getFirstRow().getStringValue("name");