Inconsistent device list behavior: dashboard vs. experience page

Hey Losanters,

I am using a device list in an overview dashboard that displays three things.

  • Device name
  • Time in service [days]
  • Some attribute value

In dashboard direct mode

Everything works as expected when i view the dashboard directly. But, when i view the same dashboard through an experience page, the ‘time in service‘ calculation doesn’t work, it shows 0.

The calculation i am using is:

{{floor (divide (subtract (currentDateTime “x”) (formatDate device.tags.InstallDate.[0] “x”)) 86400000)}}

Interestingly, if i add the InstallDate itself as a column in the device list, the correct ‘time in service‘ is shown.

So my question is: is this a bug, or expected behaviour?

This is expected behavior. When viewing a dashboard outside the context of a Losant user - that is, when it is public or viewed through an experience page - the idea is to prevent exposing additional data in the device configuration in tags unless the Losant user who built the dashboard explicitly opts in by adding that column to the block.

You should be able to use an InstallDate device tag column with a slightly modified template, though -

{{floor (divide (subtract (currentDateTime "x") (formatDate value "x")) 86400000)}}