Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
Hello,
I m trying to use the 'GetEntityList' service in Thingworx which can be found in 'EntityServices' resource. This service has couple of parameters as below:
// result: INFOTABLE dataShape: "RootEntityList" var result = Resources["EntityServices"].GetEntityList({ maxItems: undefined /* NUMBER */, nameMask: "PART" /* STRING */, type: "Thing" /* STRING */, tags: "CMU_MT_IOTServer2.0:AUTO" /* TAGS */ });
I am not able to understand about 'nameMask'. How is this parameter used? Does it take Reg-Ex as input or does it work on 'contains' mechanism? Kindly share some information/samples/examples on how to use this parameter.
Thanks in advance.
-Aditya Mittal
Solved! Go to Solution.
Hi yes it is like reg-ex, so you could use filters such as:
"*PART*" which would return anything that contains 'PART' in the name
or
"PART*" which would return anything that begins with 'PART' in the name
or
"*PART" which would return anything that ends with 'PART' in the name
so to get all Thing entities with 'PART' somewhere in the name you can use
var params = {
maxItems: undefined /* NUMBER */,
nameMask: "*PART*" /* STRING */,
type: "Thing" /* STRING */,
tags: "myTag" /* TAGS if required*/
};
// result: INFOTABLE dataShape: RootEntityList
var result = Resources["EntityServices"].GetEntityList(params);
Hi yes it is like reg-ex, so you could use filters such as:
"*PART*" which would return anything that contains 'PART' in the name
or
"PART*" which would return anything that begins with 'PART' in the name
or
"*PART" which would return anything that ends with 'PART' in the name
so to get all Thing entities with 'PART' somewhere in the name you can use
var params = {
maxItems: undefined /* NUMBER */,
nameMask: "*PART*" /* STRING */,
type: "Thing" /* STRING */,
tags: "myTag" /* TAGS if required*/
};
// result: INFOTABLE dataShape: RootEntityList
var result = Resources["EntityServices"].GetEntityList(params);
Hello,
Just to epand on @khayes1 answer:
/ Constantine
Thanks Guys for the quick response
Regards
Aditya