Dashboard to change Imperial/Metrics Units

Hello! Please your help… I build a dashboard with variables of pressure and force, how can I add a button that allows me to change the Imperial system measurements to Metric?

Tkns

Hello @Hugo_Hernan_Ruiz!

This is a question with a more complicated solution, so I am building an example for you on the best way to accomplish this, and will post a walkthrough shortly.

Thanks,
Julia

1 Like

Hello,

I have built out an example, I will walk through it so you can look into it further :grinning:

The conversion, unfortunately, is not something that can be done with a button on the dashboard, so I made use of Context Variables to get as close as possible.

I made two devices, one to hold my Imperial values, and another for my metric. This is useful as my Metric device is merely virtual, while my Imperial device would be receiving Particle data. Since it is only virtual, I use a workflow to convert my incoming Imperial state values (pounds, Fahrenheit, etc.) into Metric values and save that new state on my Metric device.



My devices are tagged with their respective units, like so:
40%20PM

Thus, within my dashboard, I am able to set up Context Variables for my device tags and device ids.
35%20PM
40%20PM

Now, I am able to use and set my Context Variables to show a converted dashboard.

Hopefully this helps,
Julia

1 Like

Thank you very much Julia, it seems like a good idea, I’m trying it … However, when I present the Dashboard from a user view this part of the menu disappears … how can I activate it? I need a user to enter and only see the dashboard … thank you very much, I appreciate your help …

image

image

Hi,

That settings menu will disappear based on permissions. If your use case does not limit your dashboards, I would recommend cloning your dashboard to make a new dashboard for Metric values, and keep the other as Imperial. That way, you will be able to still display all the data, and can link viewers to them separately.

You can also check out the dashboard permissions documentation and see what permissions are right for you!

Thanks,
Julia

1 Like

Excellent thanks a lot Julia! really your help is very important to me …

1 Like

hi Julia, I have a question, how can I click on a menu in the layout to change the dashboard? I have the menu, but I need the address to access …

Thank you!

Hugo Hernan

Hello @Hugo_Hernan_Ruiz!

It sounds as though you are hoping to have a dropdown menu with a link to a dashboard in your experience layout. If I am interpreting your question incorrectly, please let me know :smile:

If your experience page is a dashboard, you can create a link within the layout that goes to the page by using <a href=/dashboard1>. This could be used as a link within a menu, and will direct you to your dashboard page provided your endpoints are correct.

Here is a helpful walkthrough on layouts, and our documentation on experiences.

Thanks,
Julia

1 Like

Hi Julia, I made a Dashboard that changes the values depending on a context variable that dynamically references a device. This works…

When I choose the device, the dashboard is updated. The problem is when I create a user experience, this option disappears …I adjust the permissions as you indicated me but it didn’t work …

image

How can I dynamically change a context variable (device ID in this case) from a user experience? I need to click somewhere and show the data from a different device.

Thks!

Hello @Hugo_Hernan_Ruiz!

There is a forum post here on Context Variables in Experiences that should provide an explanation.

Hopefully this helps!
Julia