Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! 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.