# Device Query Match ALL mode for the Edit Gauge & Time Series blocks

**URL:** <https://forums.losant.com/t/device-query-match-all-mode-for-the-edit-gauge-time-series-blocks/5510>\
**Category:** Help\
**Tags:** dashboard\
**Created:** [July 2, 2024, 4:51pm UTC](https://forums.losant.com/t/device-query-match-all-mode-for-the-edit-gauge-time-series-blocks/5510 "2024-07-02T16:51:13Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Reinhard\_Wolfaardt](https://avatars.discourse-cdn.com/v4/letter/r/db5fbb/32.png) [@Reinhard\_Wolfaardt](https://forums.losant.com/u/Reinhard_Wolfaardt)\
**Post date:** [July 2, 2024, 4:51pm UTC](https://forums.losant.com/t/device-query-match-all-mode-for-the-edit-gauge-time-series-blocks/5510/1 "2024-07-02T16:51:13Z")

</div>

Hi guys,

Is it possible to query for devices in the Edit Gauge & Time Series blocks using the Match ALL mode? If so, am I doing something that could cause the mode to become disabled? If not, how do I go about to filter based on the value of a device property?

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/4/4b062c4f496a72891dbc9168f26beaf509e38af4.png)

Thanks!

---

<div class="post-metadata">

**Author:** ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)\
**Post date:** [July 2, 2024, 6:08pm UTC](https://forums.losant.com/t/device-query-match-all-mode-for-the-edit-gauge-time-series-blocks/5510/2 "2024-07-02T18:08:01Z")

</div>

It is not currently possible. We are working our way towards enabling full advanced query for these blocks. What you see is an intermediate release, which is why the dropdown is there, but disabled. I don’t have a timeline on when it will be available.

---

<div class="post-metadata">

**Author:** ![Blake\_Harriman](https://avatars.discourse-cdn.com/v4/letter/b/8e8cbc/32.png) [@Blake\_Harriman](https://forums.losant.com/u/Blake_Harriman)\
**Post date:** [August 14, 2024, 3:00pm UTC](https://forums.losant.com/t/device-query-match-all-mode-for-the-edit-gauge-time-series-blocks/5510/3 "2024-08-14T15:00:06Z")

</div>

Is there any easy fix to this in the meantime by any chance? Or is the only solution to just use custom HTML blocks instead?

---

<div class="post-metadata">

**Author:** ![Dylan\_Schuster](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/dylan_schuster/32/2850_2.png) [@Dylan\_Schuster](https://forums.losant.com/u/Dylan_Schuster)\
**Post date:** [August 14, 2024, 8:10pm UTC](https://forums.losant.com/t/device-query-match-all-mode-for-the-edit-gauge-time-series-blocks/5510/4 "2024-08-14T20:10:11Z")

</div>

No easy fix, sorry. I’ll talk to the team and see if it is something that can make our early October release schedule.

---

<div class="post-metadata">

**Author:** ![Dylan\_Schuster](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/dylan_schuster/32/2850_2.png) [@Dylan\_Schuster](https://forums.losant.com/u/Dylan_Schuster)\
**Post date:** [October 2, 2024, 1:18pm UTC](https://forums.losant.com/t/device-query-match-all-mode-for-the-edit-gauge-time-series-blocks/5510/5 "2024-10-02T13:18:49Z")

</div>

Following up on this - all dashboard blocks that query device telemetry data or metadata (with the exception of the Image Block) now support advanced query for targeting which devices to return.

---

<div class="post-metadata">

**Author:** ![Anshul\_Maske](https://avatars.discourse-cdn.com/v4/letter/a/eb8c5e/32.png) [@Anshul\_Maske](https://forums.losant.com/u/Anshul_Maske)\
**Post date:** [October 30, 2024, 1:13pm UTC](https://forums.losant.com/t/device-query-match-all-mode-for-the-edit-gauge-time-series-blocks/5510/6 "2024-10-30T13:13:38Z")

</div>

Hi Dylan,

Thanks for the advance query update. I was working with the device count block and implemented an advanced query, but the preview says `An error occurred`. What needs to be modified in the below query to get devices whose tag-epochFirstSeen is less than a certain number? Thanks, your help is greatly appriciated.

```auto
{
  "$and": [
    {
      "tags": {
        "$eq": {
          "$tagKey": "epochFirstSeen",
          "$tagValue": {
            "$lt": 1725022925000
          }
        }
      }
    }
  ]
}

```

---

<div class="post-metadata">

**Author:** ![Dylan\_Schuster](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/dylan_schuster/32/2850_2.png) [@Dylan\_Schuster](https://forums.losant.com/u/Dylan_Schuster)\
**Post date:** [October 30, 2024, 1:29pm UTC](https://forums.losant.com/t/device-query-match-all-mode-for-the-edit-gauge-time-series-blocks/5510/7 "2024-10-30T13:29:53Z")

</div>

Tag queries [only support string equality matches](https://docs.losant.com/references/advanced-queries/#tag-comparisons) on the keys / values, so unfortunately what you are trying to do here - store a timestamp in a tag value and do a `$lt` query against it - will not work.

I think the best approach here would be to instead store this information in a [data table](https://docs.losant.com/data-tables/overview/), where the “epochFirstSeen” is a number-type column and “deviceId” is a string-type column. Number-type columns support the kind of query you are looking for here.

Whatever logic you are using to write the device tag now would instead change to insert a row in the data table, probably checking to see if the row exists by device ID first. And while you couldn’t use the Device Count Block to visualize the number of rows matching your query, you could use a [Data Table Block](https://docs.losant.com/dashboards/blocks/data-table/) (showing the rows themselve), a [Custom Vega Chart](https://docs.losant.com/dashboards/blocks/custom-chart/), or a [Custom HTML Block](https://docs.losant.com/dashboards/blocks/custom-html/) to do so.

---

<div class="post-metadata">

**Author:** ![Anshul\_Maske](https://avatars.discourse-cdn.com/v4/letter/a/eb8c5e/32.png) [@Anshul\_Maske](https://forums.losant.com/u/Anshul_Maske)\
**Post date:** [October 30, 2024, 1:37pm UTC](https://forums.losant.com/t/device-query-match-all-mode-for-the-edit-gauge-time-series-blocks/5510/8 "2024-10-30T13:37:24Z")

</div>

I’ll try it out, Thank you.
