Dynamically create experience dashboards showing state of all devices for the logged in user

#1

I would like to created a single experience that has several groups (each with it’s own branding). Each group will have a few different users, who each have 1-5 devices. Each user should only be able to see their devices once they log in. The devices all share the same attributes and can share the same dashboard “templates”.

After log in I’d like the user to land on a dashboard that shows their devices current location on a map and each of the devices current state. I would like to avoid manually creating a dashboard for each user, since these will all be the same (except for the data block filter). Is there a way to pass either a list of devices or a current owner (currently tracked with a tag on the device) into the dashboard context?

0 Likes

#2

Here’s a nice overview that will definitely help point you in the right direction, although some of your required functionality won’t be possible until we release device tag context variable, which comes in just a couple of weeks.

1 Like

#3

Thanks for the quick response. Looking forward to the new tag context feature - that is exactly what I was looking for. I’m definitely using Display a list of devices based on experience user group for the individual device overview pages. I’ll stick with a hard coded devices view until tag context is available.

0 Likes

#4

Sounds interesting. I’m wanting to learn more about how the experience dashboards can be used.

Do you have an example setup link you could share so we can see what’s possible?

Your requirements are similar to what I want to accomplish as far as using a single dashboard layout for many users where only their device data shows up when they are logged in.

0 Likes

#5

I don’t have a public link to share, since the experience I’ve set up is based on authenticating users. But the setup is quite simple. I created an experience and had the basic login flow autogenerated for me.

For my devices dashboard I’m currently setting it up manually. For each device I add a tag “ownerId” with the user id as the value (I get this from the debug logs when a user logs in, but eventually I’ll add a flow to automate registering devices). I then create a dashboard and under the “DATA BLOCK” section in the “DeviceIds/Tags” I add a filter for the “ownerId”. When the dashboard context feature extends to include tags I’ll set the dashboard context to the current user id and will replace the filter to use the dashboard context.

For each specific device detail I’ve created a dashboard with the context set to the device id and added a link in the main dashboard that passes in the device id, so it follows the example - https://forums.losant.com/t/display-a-list-of-devices-based-on-experience-user-group/.

In the experience I added a couple pages that point to these dashboards. For the main devices dashboard I just replaced the example home page in the workflow with the dashboard page. For the device details pages I had to add an endpoint (/devices/{deviceId}) and workflow that pointed to the device detail dashboard page.

1 Like