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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

How Can I get a All Thing Templates

pshashipreetham
17-Peridot

How Can I get a All Thing Templates

Hi,

 

I have a Thing Template named "CommonThingTemplate", there are 5 ThingTemplates created based on the CommonThingTemplate.

 

Now how can I get all the ThingTemplates created based on the CommonThingTemplate?

 

Thanks,

 

Shashi Preetham
1 ACCEPTED SOLUTION

Accepted Solutions
nmutter
14-Alexandrite
(To:pshashipreetham)

You could use

let result = ThingTemplates["CommonThingTemplate"].GetIncomingDependenciesAsNetwork({
	maxDepth: 1 /* NUMBER {"defaultValue":10} */,
	maxItems: undefined /* NUMBER {"defaultValue":500} */
});

// only consider items with parentType == "ThingTemplate"

I am not aware of a direct query like 'QueryImplementingThingTemplates' which exists for Things (QueryImplementingThings).

 

View solution in original post

1 REPLY 1
nmutter
14-Alexandrite
(To:pshashipreetham)

You could use

let result = ThingTemplates["CommonThingTemplate"].GetIncomingDependenciesAsNetwork({
	maxDepth: 1 /* NUMBER {"defaultValue":10} */,
	maxItems: undefined /* NUMBER {"defaultValue":500} */
});

// only consider items with parentType == "ThingTemplate"

I am not aware of a direct query like 'QueryImplementingThingTemplates' which exists for Things (QueryImplementingThings).

 

Top Tags