Dynamically change the body of the request depending on dashboard variables #248
Replies: 6 comments
-
Thank you for the kind words, and for your suggestion on how to improve the plugin! ❤️ It sounds like this would require adding support for a more advanced templating language, such as Handlebars. I don't think it would have that big of an impact on UX (a checkbox to enable templating?), but it would require another non-trivial dependency which I'm hesitant to add without feedback from more users. |
Beta Was this translation helpful? Give feedback.
-
Yes I understand your point of view. However we have to escape the request as a string (it is no longer a valid JSON), making it very difficult to maintain/debug. |
Beta Was this translation helpful? Give feedback.
-
Adding this to the backlog as there seems to be some support for this feature. |
Beta Was this translation helpful? Give feedback.
-
Hello and thanks for the wonderful work! I'd like to bump this issue, since in my case, I need to send timestamps (taken from the Time picker) in the body of the request. In SQL, this would be done with $__timeFrom(), but I haven't been able to do this in the plugin. Simplified request example: Cheers! |
Beta Was this translation helpful? Give feedback.
-
So do we have a way for this , I am using Json api plugin and want to change the body according to the field variables. |
Beta Was this translation helpful? Give feedback.
-
Not sure if anyone is still following this issue, but here is how to dynamically change body variables: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, and thank you for your excellent work.
Is it possible to dynamically change the body of the request depending on dashboard variables ?
I have cases where depending on the value of a textbox (if it is empty or not), the query I have to send to the backend needs to be changed (elasticsearch clause needs to be removed).
Thank you.
EDIT: Another solution could be to send different queries depending on a grafana variable (but it would still require a condition test).
Beta Was this translation helpful? Give feedback.
All reactions