Cannot write into a variable with javascript in text panel

  • What Grafana version and what operating system are you using?
    Grafana v10.4.3 (0bfd547800)

  • What are you trying to achieve?
    Hello together,
    I want to write in an Microsoft SQL DB directly from a dashboard. I try to do this with the use of 2 variables. 1 variable where i type in a value and another that uses that variable to make an update to the sql data source. It’s a workaround but it works. i did not find another way to write to sql directly.

  • How are you trying to achieve it?
    Now i want to set the first variable with a javascript code in a text panel. javascript in general is enabled and works for other stuff already. Apparently there is a possibility to do this (see my code) but i just get error messages galore in the console.

  • What happened?
    Error:
    TypeError: Failed to resolve module specifier “@grafana/runtime”. Relative references must start with either “/”, “./”, or “…/”.

So…what can be the issue here?

Do you have other ideas to write to a SQL DB apart from my trick with the variables?

The problem is that i cannot install a lot of other plugins apart from the ones i have an also have no clue about my specific installation because i am working in a big corporate environment that is managed by our IT and specific plugins and extensions are hard to get.
Thanks a lot for any input you might have!

hello @paulchenpanther

check this plugin out for such

Thanks yosiasz, indeed the plugin looks very nice. I am a little bit jaelous on everybody who has the power to install additional plugins as needed. For me it is difficult because my grafana is managed and hosted by somebody else in the company. But I will try to convince them to change this. But probability is very high that I have to manage the stuff with grafana standard stuff.
So any other trick would be great :wink:

1 Like