|
Parameter Name
|
Description
|
BaseType
|
|---|---|---|
|
thingReferences
|
An infotable that consists of a list of Things.
The expected Data Shape for the infotable is EntityReference.
|
INFOTABLE
|
|
dataShapeName
|
Name of the Data Shape that encapsulates the values of the properties to be returned by the query.
The Data Shape must exist in the ThingWorx model. The Data Shape can be a system entity or a user-defined entity.
|
DATASHAPENAME
|
|
Parameter Name
|
Description
|
Base Type
|
|---|---|---|
|
result
|
Returns an infotable with the values for properties requested in the Data Shape for each Thing requested in the thingReferences input.
The Data Shape of the return infotable will contain the name of the Thing and all properties in the input Data Shape.
|
INFOTABLE
|
|
Entity
|
Properties
|
|---|---|
|
Thing1
|
Property1
|
|
Thing2
|
Property1, Property2
|
|
Thing3
|
Property1, Property2, Property3
|
|
TestStream
|
Property1, Property2, Property3
|
|
TestDatashape
|
Property1, Property3, Property4
|
// Create a thingRef Infotable with the datashape EntityReference
var thingRefInfoTableParams = {
infoTableName : "InfoTable",
dataShapeName : "EntityReference"
};
var thingRef = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(thingRefInfoTableParams);
// populate thingRef InfoTable
var thing1Entry = new Object();
thing1Entry.name = "Thing1"; // STRING
thing1Entry.type = "Thing"; // STRING
var thing2Entry = new Object();
thing2Entry.name = "Thing2"; // STRING
thing2Entry.type = "Thing"; // STRING
var thing3Entry = new Object();
thing3Entry.name = "Thing3"; // STRING
thing3Entry.type = "Thing"; // STRING
var streamEntry = new Object();
streamEntry.name = "TestStream"; // STRING
streamEntry.type = "Thing"; // STRING
thingRef.AddRow(thing1Entry);
thingRef.AddRow(thing2Entry);
thingRef.AddRow(thing3Entry);
thingRef.AddRow(streamEntry);
// result: INFOTABLE dataShape: "RootEntityList"
result = Resources["EntityServices"].GetThingPropertyValues({
thingReferences: thingRef /* INFOTABLE */,
dataShapeName: "TestDatashape" /* DATASHAPENAME */
});
|
thingName
|
Property1
|
Property3
|
Property4
|
|---|---|---|---|
|
Thing1
|
11
|
||
|
Thing2
|
21
|
||
|
Thing3
|
31
|
33
|
|
|
TestStream
|
S1
|
S3
|