I’m struggling with the next issue and I hope someone will be able to help / guide me in the right direction.
I have a dashboard with several cells, for some cells I need to update the last time a certain action was executed. For instance the last time I refuelled the oil storage tank.
To update this date I every time need to edit the query range start:
I’m wondering if I can not setup a Dashboard variable instead, I can then have a visual of the last timestamps by making the variables visible and in case of a change I can just edit the new timestamp in the variable instead of in the query.
I’ve tried a lot of different things but without success. I keep receiving errors about ‘stream’, ‘time expected, string returned’ …
Thanks in advance for the help/tips on how I should proceed.
@Chris_Home You can certainly use a dashboard variable to do this. There are a few things to note:
There currently isn’t a dashboard variable type that you can easily customize while viewing the dashboard (something like a text field), so you’d have to go in the variables menu to update the value(s) available for this variable.
Custom dashboard variable values are always strings. To use a custom dashboard variable as a start value, you need to cast it to a time type:
It’s fine for me if I have to update the variable when needed (easier than to update my different queries)
I captured that it was returned as a string. I’m struggle configuring the variable itself… I have just done some additional tests with also adding time(v: v.myCustomerVariable) to the range but still without success.
Maybe you have a sample of what I should input in the variable itself?
One thought – If you’re recording these “events” in InfluxDB (writing them as time series data to a bucket), you can query them out. For example, if you automatically wrote a new point to InfluxDB every time you refueled the storage tank, you could get the time of the last event. Your variable query would be something like: