Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
I am trying to use the new QueryImplementingThingsWithNamedData service in Thingworx.
According to the help file I need to have the basicPropertyNames as a InfoTable. How does this info table look or where do I get this infotable?
This is how my query looks currently:
var result = ThingTemplates["GGC.RC.TT"].QueryImplementingThingsWithNamedData({
maxItems: undefined /* NUMBER */,
basicPropertyNames: "SampleCode" /* INFOTABLE */,
nameMask: undefined /* STRING */,
propertyNames: undefined/* INFOTABLE */,
query: undefined /* QUERY */,
tags: undefined /* TAGS */
});
Thanks
Solved! Go to Solution.
Hi @AndreaSteyn
Apologies for the delay in answering.
The propertyNames and basicPropertyNames are infoTable using the EntityList system dataShape.
For example
var params = {
infoTableName : "InfoTable",
dataShapeName : "EntityList"
};
// CreateInfoTableFromDataShape
var propInfoTable = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);
// EntityList entry object
var newEntry = new Object();
newEntry.name = "prop1"; // STRING [Primary Key]
newEntry.description = undefined; // STRING
propInfoTable.AddRow(newEntry);
// CreateInfoTableFromDataShape
var basicpropInfoTable = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);
// EntityList entry object
var newEntry = new Object();
newEntry.name = "name"; // STRING [Primary Key]
newEntry.description = undefined; // STRING
basicpropInfoTable.AddRow(newEntry);
var result = ThingTemplates["CMOTemplate"].QueryImplementingThingsWithNamedData({
maxItems: undefined /* NUMBER */,
nameMask: undefined /* STRING */,
propertyNames: propInfoTable,
basicPropertyNames: basicpropInfoTable,
query: undefined /* QUERY */,
tags: undefined /* TAGS */
});
Hope this helps
Christophe
Hi @AndreaSteyn
Apologies for the delay in answering.
The propertyNames and basicPropertyNames are infoTable using the EntityList system dataShape.
For example
var params = {
infoTableName : "InfoTable",
dataShapeName : "EntityList"
};
// CreateInfoTableFromDataShape
var propInfoTable = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);
// EntityList entry object
var newEntry = new Object();
newEntry.name = "prop1"; // STRING [Primary Key]
newEntry.description = undefined; // STRING
propInfoTable.AddRow(newEntry);
// CreateInfoTableFromDataShape
var basicpropInfoTable = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);
// EntityList entry object
var newEntry = new Object();
newEntry.name = "name"; // STRING [Primary Key]
newEntry.description = undefined; // STRING
basicpropInfoTable.AddRow(newEntry);
var result = ThingTemplates["CMOTemplate"].QueryImplementingThingsWithNamedData({
maxItems: undefined /* NUMBER */,
nameMask: undefined /* STRING */,
propertyNames: propInfoTable,
basicPropertyNames: basicpropInfoTable,
query: undefined /* QUERY */,
tags: undefined /* TAGS */
});
Hope this helps
Christophe
Thank you that was very helpful.