Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
While creating a thingtemplate,and want compare thingtemplate's properties names against existing thingtemplate properities name, I want to validate that we reuse thingtemplate and do not create if there is one that have the necessary properties
Solved! Go to Solution.
It's not available on the template level, but you may try to use GetInstancePropertyDefinitions with the infotable returned. Please keep in mind you cannot "test" a service on the template level, you would have to create a new service in a thing and access the template services through it.
Could you please clarify - you are creating a thingtemplate and comparing the property names against a different thingtemplate? Or adding new properties to the newly created thingtemplate and comparing them to the existing ones in the same template?
You may use try/catch and run a service on the property, if it doesn't exist and you get an error, then proceed to creating one.
What I am trying to do is while creating a new thingtemplate, compare the properties names again existing thingtemplates
Such a service is not available out of the box. What I see as a workaround/potential solution, is to keep all existing properties in some datatable, then checking for a matching entry before creating a new property. Or running the GetProperties service that returns an infotable and comparing the row value.
now my question is which service to execute in order to get the list of thingtemplate exisiting on tw?
You should be able to use GetEntityList specifying thing template as the type.
Hi armando luna, If this Issue is resolved; could you please mark correct answer to let other members know that this Thread has a solution.
just one thing, I do not find the GetProperties service
It's not available on the template level, but you may try to use GetInstancePropertyDefinitions with the infotable returned. Please keep in mind you cannot "test" a service on the template level, you would have to create a new service in a thing and access the template services through it.