Navigate to an specific device dashboard by name

What product/components do you use and which version/fix level are you on?


Is your question related to the free trial, or to a production (customer) instance?

a production

What are you trying to achieve? Please describe it in detail.

Our custom widget shows a list of devices and its info. I need by clicking on a specific info, user navigate to an specific dashboard for that device. How can I get dashboard’s id for the device?
like this code snippet. How can I get dashboard id heret?

This dashboard id is different in each tenant, but has a same name in all of our tenant!

Do you get any error messages? Please provide a full error message screenshot and log file.

Have you installed all the latest fixes for the products and systems you are using?


The UI uses a request to /inventory/managedObjects?fragmentType=c8y_Dashboard!device!<deviceId>&pageSize=1000 to retrieve the device specific dashboards and a request to /inventory/managedObjects?fragmentType=c8y_Dashboard!type!<deviceType>&pageSize=1000 to get the device type dashboards of current device.
You need to replace <deviceId> with your devices id and <deviceType> with your device type.

You can make the same request once user clicks on your “specific info” to get the correct dashboardId to navigate to.

If your dashboard has a specific name, you could adjust the query to also filter for the dashboards name. Details regarding the query language can be found here.
A query that filters for name and deviceId might look like this:
/inventory/managedObjects?pageSize=1000&query='' eq '<dashboardName>' and has(c8y_Dashboard!device!<deviceId>)


1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.