Dashboard JSON templating variable skip current value

Hi!

One of my hidden variables on a dashboard has a big amout of data.
I need it because it fetches once in the variable and then used across multiple panels.

“skipUrlSync” is a really helpful option, so that this huge value doesn’t overwhelm the URL.
However, this option is missing on the UI and it took me some time to discover it. Is there any feature request for that, or should it be created?

Now, the only problem I have is when I export the dashboard in JSON, to provision it, or to share it another system, in the resulting JSON it puts the current huge value of that variable.
Is it possible to make something like “skipCurrentValueSync” option for a variable, so that during export it won’t store the current value of this variable?

Those current values are really messy sometimes even when there are no huge values.

I would appreciate any help.

2 Likes

Today I was trying to solve this issue, googled it and found this post in google.
“Oh, this is exactly what I need” - my thought. And suddenly I figured out it was actually me posting this two years ago.

Sorry to bump this topic.

1 Like

I am really thankful that you made that post. :slightly_smiling_face:

This is a feature that I was looking for, and I am glad it exists as I needed exactly that.
I am surprised by the lack of documentation on this essential option!

It should be offered in the UI as a checkbox or a menu.

2 Likes

what is the datasource of this variable that is bringing such a huge amount of data (sql, rest api)? Can it broken down by some sort of data grouping so that you have 2+ groups variables that are used to further filter the secondary group? Until this feature request is implement (this feature request should be really asked in grafana github)

For my part, and I am sorry that I might not have been clear in my message, I was referring specifically to the feature skipUrlSync that is really useful, as having global variables in Grafana dashboards is essential, and we do not always want such variables to be linked to the url (for several reasons).
The feature exists (and so helpful for me) and it is wonderful ; it should be documented and available in the UI as I struggled to find this.

As for the JSON template side of the original post, I leave this to the original author…

1 Like

The datasource is a Postres database. The Postgres query returns a table of 4 columns, and about 400+ rows. Then the query is wrapped into json_agg (Postrgres function) so that it converts the query result into a JSON string. Then, in many multiple panels of the dashboard, this JSON is converted back into tabular view via json_array_elements and similar functions.

The query in the variable is the core data that provides relationships between data points. The multiple panels are using this core result and do further transformations in different way.

So, library panels or something like that, can’t be used here, as I need some simple SQL-based customization per every panel.

Creating view on the database itself also isn’t possible, because we have no control of the database, but rather create dashboards using this (external to us) Postgres data source.

So the dashboard works good enough. It’s just that when someone exports JSON, there is this huge JSON string a value, which is actually not needed. And this export and import functionality is heavily used.

1 Like

Why all this tab to json to tab?

Simply because one query can be used across multiple panels, I need the same data in multiple places.

The usage of Library Panels is not possible, as the dashboard must be provisioned, I need to be able to export and import it to a different environment where this lib panel might not exist.