# \[Solved\] Device tag as dashboard context string

**URL:** <https://forums.losant.com/t/solved-device-tag-as-dashboard-context-string/829>\
**Category:** Help\
**Created:** [March 23, 2018, 2:56am UTC](https://forums.losant.com/t/solved-device-tag-as-dashboard-context-string/829 "2018-03-23T02:56:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim\_lamborn](https://avatars.discourse-cdn.com/v4/letter/t/c5a1d2/32.png) [@Tim\_lamborn](https://forums.losant.com/u/Tim_lamborn)\
**Post date:** [March 23, 2018, 2:56am UTC](https://forums.losant.com/t/solved-device-tag-as-dashboard-context-string/829/1 "2018-03-23T02:56:29Z")

</div>

Hi,

My devices all have a tag called “Site”.

If I use `https://app.losant.com/dashboards/5aa32cbcf45d3f00075f9488?ctx[deviceId-0]={{deviceId}}&ctx[string-0]={{deviceTags.Site}}` as the URL for a device list node on a dahsboard, the URL it generates always has an empty string for string-0.

If I use `https://app.losant.com/dashboards/5aa5ecbcf45d3f00075f9488?ctx[deviceId-0]={{deviceId}}&ctx[string-0]={{deviceName}}` it works correctly.

Any ideas?

---

<div class="post-metadata">

**Author:** ![Erin\_Thompson](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/erin_thompson/32/501_2.png) [@Erin\_Thompson](https://forums.losant.com/u/Erin_Thompson)\
**Post date:** [March 23, 2018, 2:06pm UTC](https://forums.losant.com/t/solved-device-tag-as-dashboard-context-string/829/2 "2018-03-23T14:06:39Z")

</div>

Hi,

The way to get the deviceTag Site onto the URL, would be like `{{ valueByKey deviceTags 'Site' 'key' 'value' }}`. It is a little confusing but deviceTags is actually an array of objects, e.g. `[{ "key": "Site", "value":"foo" }]`. We will add a better example at the bottom of that Device List Block, that explains how to access the device tags. These URL helpers can be found at in our docs on the [access payload data](https://docs.losant.com/workflows/accessing-payload-data) page.

Hope that helps,

Erin

---

<div class="post-metadata">

**Author:** ![Tim\_lamborn](https://avatars.discourse-cdn.com/v4/letter/t/c5a1d2/32.png) [@Tim\_lamborn](https://forums.losant.com/u/Tim_lamborn)\
**Post date:** [March 27, 2018, 12:07am UTC](https://forums.losant.com/t/solved-device-tag-as-dashboard-context-string/829/3 "2018-03-27T00:07:18Z")

</div>

Thanks Erin. I always forget that valueByKey thing. So many times I have forgotten that!
