Skip to main content
1-Visitor
July 6, 2017
Solved

How can I get the ThingTemplate implemented by a Thing?

  • July 6, 2017
  • 3 replies
  • 3933 views

I have this service to get the ThingTemplate implemented by a set of Things wich implements different Thing Templates.

The code:

result = Things[ThreeInput].GetImplementedThingTemplates().toInfoTable();

But when testing it, it throws the following error:

Does anybody knows what is the solution to this?

Thanks on advance.

Best answer by CarlesColl

Hi Josue,

Alternatively to GetThingTemplate() which returns an infotable of just one row, you can also use .thingTemplate Thing's property

Best Regards,

Carles.

3 replies

14-Alexandrite
July 7, 2017

Josue Serrano​,

A Thing could only extends one Thing Template but it could implement more than one Thing Shapes, so in your case, if you want to get the Thing Template a Thing extends/implements, you should do with:

result = Things["TestThing"].GetThingTemplate();

If you want to get the Thing Shape list a Thing Implemented, you need do with:

var result = Things["TestThing"].GetImplementedShapes();

Hope this helps,

Br,

Anna

1-Visitor
July 7, 2017

Hi Josue,

Alternatively to GetThingTemplate() which returns an infotable of just one row, you can also use .thingTemplate Thing's property

Best Regards,

Carles.

1-Visitor
July 7, 2017

Such a noob mistake. I Think I have to go back to study Thingworx basics.

I appreciate the answer.