We have created hierarchical structure of assets and device with 1+ levels of hierarchy.
For eg:
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.
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.