question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Template variable not updating

See original GitHub issue

Hello @marcusolsson, first of all: Useful plugin, thanks!

I encountered an issue.

Scenario The JSON plugin is used to define a template variable json-var. Inside the “Fields” tab, another template variable var (e.g. of type “Custom”) is used: $.mapping[?(@.attr == '$var')].something. image

Expected behavior json-var is always updated when var is updated.

Actual behavior json-var isn’t updated when var is updated. Only once during creation of json-var it is initialized correctly according to var.

Environment Grafana 7.5 Neither changing “Refresh” option nor “Cache Time” solves the issue.

Basically, I would like to use a template variable inside the “Field” configuration of the “Fields” tab. How can I get it working?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ugoleleuxcommented, Apr 27, 2022

@mlcdf

@ugoleleux: not all heroes wear capes. Thank you for the workaround, it works great!

I’m glad it helped you, I spent so much time discovering this workaround. 😃

1reaction
ugoleleuxcommented, Dec 13, 2021

@marcusolsson https://github.com/marcusolsson/grafana-json-datasource/issues/216#issuecomment-992540623 I just updated the closed issue, but here is my entry again on this case : I found a new behavior that will help you in your analysis. I have a variable $name that contains a list of choices. This variable is used inside a child variable on the Params tab : image

When I look at the dependency tree, the $name var is not used by $child image

If I refer $name variable in the Path tab : image

This time, the dependency tree is well seeing the relation. image

By doing this little change, my child var is now updated on the fly when I modify the $name.

I hope this will help you to correct this issue 😃

Regards Ugo

Read more comments on GitHub >

github_iconTop Results From Across the Web

Component template variable not updating when service ...
Because the variable isSignedIn in HomeComponent is assigned once in it's constructor and never re-assigned. And you are on the right path ...
Read more >
Template variable not updating · Issue #95 - GitHub
Basically, I would like to use a template variable inside the "Field" configuration of the "Fields" tab. How can I get it working?...
Read more >
Angular - Not Detecting Change, Updating Variable When ...
In the Angular app, we need to make changes in local variables which are getting used and defined as global. These variable or...
Read more >
Component template variable not updating when service ...
Coding example for the question Component template variable not updating when service emits a change (angular)-rx.js.
Read more >
HTML won't update after variable change : r/Angular2 - Reddit
HTML won't update after variable change. Hi there. I'm pretty new to angular and I'm stuck at something that could be really simple...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found