# \[Solved\] Context attribute as a filter

**URL:** <https://forums.losant.com/t/solved-context-attribute-as-a-filter/2854>\
**Category:** Help\
**Tags:** dashboard, workflow, context-variables\
**Created:** [April 21, 2020, 2:13pm UTC](https://forums.losant.com/t/solved-context-attribute-as-a-filter/2854 "2020-04-21T14:13:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Flavio\_Garlet](https://avatars.discourse-cdn.com/v4/letter/f/5e9695/32.png) [@Flavio\_Garlet](https://forums.losant.com/u/Flavio_Garlet)\
**Post date:** [April 21, 2020, 2:13pm UTC](https://forums.losant.com/t/solved-context-attribute-as-a-filter/2854/1 "2020-04-21T14:13:20Z")

</div>

So, I have a single device acting as a gateway, it receives data from several devices. This gateway has an attribute called “Name”, for example “55b8”, “00c3”, depending on the device that sent the data to the gateway.

I have a dashboard for showing the attribute called “Temperature”, the thing is, I need to filter, I want to have the option to choose “55b8” and my dashboard shows the attribute Temperature for the data which has the attribute “Name” = “55b8”.

If I choose “00c3”, I want the dashboard to show the attribute “Temperature” for the data which has the attribute “Name” = “00c3”.

---

<div class="post-metadata">

**Author:** ![JuliaKempf](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/juliakempf/32/2446_2.png) [@JuliaKempf](https://forums.losant.com/u/JuliaKempf)\
**Post date:** [April 21, 2020, 3:34pm UTC](https://forums.losant.com/t/solved-context-attribute-as-a-filter/2854/2 "2020-04-21T15:34:30Z")

</div>

Hi @Flavio_Garlet,

Just a quick clarifying question, are you utilizing only one device in Losant? It sounds as though your environment has a gateway/peripheral relationship, which could be [replicated in Losant with Gateway and Peripheral devices](https://docs.losant.com/devices/gateways-peripherals/). Is this something you’ve considered or implemented? There is also a thorough forum post [here on how they work in Losant](https://forums.losant.com/t/gateways-and-peripherals/2125/3).

This device relationship in Losant would allow you to create the dashboards you have described, as each peripheral (“55b8”, “00c3”) would be an individual device and could be used within the dashboards.

Thanks!  
Julia

---

<div class="post-metadata">

**Author:** ![Flavio\_Garlet](https://avatars.discourse-cdn.com/v4/letter/f/5e9695/32.png) [@Flavio\_Garlet](https://forums.losant.com/u/Flavio_Garlet)\
**Post date:** [April 21, 2020, 5:35pm UTC](https://forums.losant.com/t/solved-context-attribute-as-a-filter/2854/3 "2020-04-21T17:35:04Z")

</div>

Hi Julia, I managed to get it working, modifying my workflow (I think I did the hard way but it’s working)

A new problem appeared, I was going to share the dashboard with my coworker, but in my developer mode, i can select the device:

 ![Screenshot (377)](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/e/e6c3db2546124f9ff6acfb22afd3bf704e2e1cf6.png)

When I shared the link to view, the only option is to type the device ID, which is kind of impossible because it’s a big number haha

 ![Screenshot (376)](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/f/f5e2157f22610febea37aab2203634deb76204ae.png)

How can I have a selection box in the viewer side?

---

<div class="post-metadata">

**Author:** ![JuliaKempf](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/juliakempf/32/2446_2.png) [@JuliaKempf](https://forums.losant.com/u/JuliaKempf)\
**Post date:** [April 21, 2020, 7:03pm UTC](https://forums.losant.com/t/solved-context-attribute-as-a-filter/2854/5 "2020-04-21T19:03:34Z")

</div>

Hi @Flavio_Garlet,

Great! Thank you for the screenshots as well, they are quite helpful. 😄

When a non-member of your organization is linked to your public dashboard, these fields expect strings for security, as the link is accessible to anyone.

There are a couple of ways you can accomplish this, however. You could add a [Device List Block](https://docs.losant.com/dashboards/device-list/) and allow the user to copy the deviceId from the block. You could also configure the device names to link to your dashboard with the correct deviceId, like so:

 ![Screen Shot 2020-04-21 at 3.00.57 PM](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/0/0e43e42f5228436c926c529a72d65788b979a257.png)

Clicking `Alarm 1` will now route me to my dashboard with `Alarm 1` as my context device.

 ![Screen Shot 2020-04-21 at 3.01.30 PM](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/7/7b614682e3d72d69e299ac5785a38cab74bddac2.jpeg)

Let me know if this suggestion doesn’t fit your use case.

Thanks!  
Julia

---

<div class="post-metadata">

**Author:** ![Flavio\_Garlet](https://avatars.discourse-cdn.com/v4/letter/f/5e9695/32.png) [@Flavio\_Garlet](https://forums.losant.com/u/Flavio_Garlet)\
**Post date:** [April 21, 2020, 7:15pm UTC](https://forums.losant.com/t/solved-context-attribute-as-a-filter/2854/6 "2020-04-21T19:15:08Z")

</div>

It worked perfectly, thanks!

---

<div class="post-metadata">

**Author:** ![Flavio\_Garlet](https://avatars.discourse-cdn.com/v4/letter/f/5e9695/32.png) [@Flavio\_Garlet](https://forums.losant.com/u/Flavio_Garlet)\
**Post date:** [April 24, 2020, 5:50pm UTC](https://forums.losant.com/t/solved-context-attribute-as-a-filter/2854/8 "2020-04-24T17:50:31Z")

</div>

@JuliaKempf, I have another little problem, I created an Experience View to show this dashboard in a custom URL, how can I link the device list using Experience view?

---

<div class="post-metadata">

**Author:** ![JuliaKempf](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/juliakempf/32/2446_2.png) [@JuliaKempf](https://forums.losant.com/u/JuliaKempf)\
**Post date:** [April 24, 2020, 8:21pm UTC](https://forums.losant.com/t/solved-context-attribute-as-a-filter/2854/10 "2020-04-24T20:21:26Z")

</div>

Hi @Flavio_Garlet,

You have a couple of options for accomplishing this.

If you would like to link using the Device List Block, you can reconfigure the block with your experience domain, like so:

 ![Screen Shot 2020-04-24 at 3.59.13 PM](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/6/6053065fd6b4f64d621582949e52c8263b60030c.png)

Clicking the device name navigates to the experience dashboard page for the specific device:

 ![Screen Shot 2020-04-24 at 4.03.17 PM](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/e/eea5a3725e559c322a411ef26073c66089e8bd9c.png)

You also have the option of creating your own custom navigation using experiences. The [Industrial Equipment Monitor application template](https://docs.losant.com/templates/industrial-equipment-monitor/) comes preconfigured with a device navigation menu you can use as a base or for reference:

 ![Screen Shot 2020-04-24 at 4.17.50 PM](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/e/eff98f1591ae921f9d54450c8c83088a38ae5663.png)

Let me know if either of these will work for your use case. 😄

Thanks!  
Julia

---

<div class="post-metadata">

**Author:** ![Flavio\_Garlet](https://avatars.discourse-cdn.com/v4/letter/f/5e9695/32.png) [@Flavio\_Garlet](https://forums.losant.com/u/Flavio_Garlet)\
**Post date:** [April 27, 2020, 6:55pm UTC](https://forums.losant.com/t/solved-context-attribute-as-a-filter/2854/12 "2020-04-27T18:55:24Z")

</div>

Hey, I managed to get the first one working, but with a modification, i had to put the context variable “{{request.query.device}}”, then, the solution worked 🙂 Thanks!
