get all implemented things with a certain property in a service
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
get all implemented things with a certain property in a service
Hello,
i have thing template with a property of type THINGNAME.
i'm writing a service and in there i need to get a list of all thing that implement that template and have a certain thingname as that property.
How can i do that?
I assume can somehow call the getImplementedThings service and compare the property each element. If that is the easiest solution, how do i call that service?
- Labels:
-
Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
If you want just get the name of the things is easier than you think, but I don't know if is that what you want.
What do you want to do with this thingname property?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
i need to read properties of those things
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
The service GetImplementingThingsWithData() doesn't suit you? You will iterate all the things and properties.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @jsladojevic.
If one of the previous posts provided a solution to your question, please mark it as the Accepted Solution for the benefit of others who may have the same question. If you found a different solution, please post the details here and mark that as the Accepted Solution.
Regards.
--Sharon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You can call the service on the template:
ThingTemplates["BlaTemplate"].GetImplementingThings();
// loop each element
But if I understand your problem correctly the only thing you need is:
result = me.PropertyWithThingname;
You don't need to iterate through every element if you have the thingname.
![](/skins/images/695EE5AD3E567050FEDD72575855ED93/ptc_skin/images/icon_anonymous_message.png)