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?
Thanks!
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.
1 Like
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?
No easy fix, sorry. I’ll talk to the team and see if it is something that can make our early October release schedule.
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.
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.
{
"$and": [
{
"tags": {
"$eq": {
"$tagKey": "epochFirstSeen",
"$tagValue": {
"$lt": 1725022925000
}
}
}
}
]
}
Tag queries only support string equality matches 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, 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 (showing the rows themselve), a Custom Vega Chart, or a Custom HTML Block to do so.
I’ll try it out, Thank you.