Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
I have several Things named "thing1", "thing2", "thing3", "thing4", etc, which I want to delete. I am thinking of a way to first 'Find' or 'Query' or 'Search' the Things that begins with "thing" and then 'Delete' them. Nevertheless, I do not know which service to use to 'Find' or 'Query' or 'Search' Things.
Anybody knows what service do I need? Or is there any better solution to my intention?
thanks
Solved! Go to Solution.
You can try this, i think this fits your requirement more
var params = {
maxItems: 500 /* NUMBER */,
nameMask: "<provide entity name here>" /* STRING */,
type: 'Thing' /* STRING */,
tags: undefined /* TAGS */
};
// result: INFOTABLE dataShape: RootEntityList
var result = Resources["EntityServices"].GetEntityList(params);
Note that you can use the Type to seach for different entities like Things, Mashups, Users etc
You can find this together with other EntityServices under the Snippets > EntityServices
Hi Samuel, you can consider using one of the following search functions available directly under the ThingWorx Composer > System > Resources > SearchFunctions
Hope this helps.
Hi Sushant, thank you for your reply! Could you, please, be more specific about what Inputs I should enter in order to search the Things I need? I took a look at the Inputs of these three services but just couldn't find 'names' in them. Does that mean I can't search things by name? Or are there other ways to try?
You can try this, i think this fits your requirement more
var params = {
maxItems: 500 /* NUMBER */,
nameMask: "<provide entity name here>" /* STRING */,
type: 'Thing' /* STRING */,
tags: undefined /* TAGS */
};
// result: INFOTABLE dataShape: RootEntityList
var result = Resources["EntityServices"].GetEntityList(params);
Note that you can use the Type to seach for different entities like Things, Mashups, Users etc
You can find this together with other EntityServices under the Snippets > EntityServices
Thank you, Sushant. It worked! Thanks a lot for your help!
Glad it worked out