We have created hierarchical structure of assets and device with 1+ levels of hierarchy.
Subsystem - group
IAQ - subgroup
device 1 - device
subgroup2 - subgroup
device 2 - device
So with the above structure if i have to retrieve all the devices within the Subsystem group, is there any way i can retrieve all the devices in one call?
Currently, im getting the getting the child assets of the group and checking if the type is device or group. if it is group then i’m querying it again to get all the child assets which is a inefficient way to get all devices. So please advice me how can i get the result in an efficient way.
sorry, I don’t think there is another way. This should be implemented in the backend though…
there will be a new feature coming in the future called
Materialized Path, which allows you to query the full hierarchy for a group in one single query. But not sure if it is already coming with 10.16 or 10.17.
For now, I think you will need to use
bygroupid() and the query language as described here to construct your query to get all devices in one single query.
Thanks for the response. If I have to make use of bygroupid() then I should know all the subgroup ids in prior right?
Yes, you would need to know the underlying subgroups and their ids.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.