cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Get List of all Thing Templates

drieder
15-Moonstone

Get List of all Thing Templates

Hello Everyone,

 

i am struggling with finding out how to get a list of all ThingTemplates (or at least their names) in the TWx Platform. Optionally it would be nice to filter these on "has things that implement template" and "does not have things that implement template".

 

In the Platform API Documentation i found a method on ThingTemplates:

 

getAllImplementedThingTemplates() -> returns an EntityReferenceCollection

 

But i don't know how to invoke this service properly (e.g What is the name of the Entity this service is invoked on?) 

 

Any help is appreciated very much.

 

Regards,

Dominik

3 REPLIES 3
PaiChung
22-Sapphire I
(To:drieder)

You are probably better off using the SearchFunctions resource, there is a SearchEntities or SpotlightSearch and you can set the type to ThingTemplate. parameter call out would be: types: {items: ["ThingTemplate"]}

In the UI you can use the Entity Picker

drieder
15-Moonstone
(To:PaiChung)

Thank you, this indeed lists all Templates (even System Objects). 

 

Any Idea how to filter these Properly? The results of a search call have an attribute called "isSystemObject", but i wasn't able to write an expression neither in the "excluded aspects" nor in the "searchExpression" parameter field for the search function (using SpotlightSearch btw).

 

Something like: show only if isSystemObject == false.

 

Thanks for your collaboration!

 

Regards,

Dominik

PaiChung
22-Sapphire I
(To:drieder)

You can try the search expression but it won't be reliable because it does a text search.

However after you get the search result it is an infotable and you can do a .Query

In the Thingworx help do a search for Search Parameters to find out how to build proper queries.

Top Tags