Data Manipulation Plugin: Custom Code Parameters(elements,data) are not working in "Form Events"> "Element Value Change" Section

Hello,
New to grafana here.

I am developing a form using this stellar plugin, I am able to send update query to database using the value passed from the form into the elements.value parameter =>
image

And according to the docs here, there are some parameters we can use.

But I cannot use them using javascript code in the Form Events property area(Element Value Changed =>Code to run when element value changed).

Any idea?

Wonder if this section is pertinent

Custom code is executed after the Initial and Update requests.

@wxyzabc190 It’s the new functionality, we have not updated in the docs.

Please use the context to access all parameters, it works for Initial, Update requests and supports suggestions in the Code Editor.

Let me know if there is anything else.

1 Like

@mikhailvolkov
Eagerly waiting for the new feature and docs. But for the time being, could you kindly clarify one thing?

See I am returning context.panel.elements and it returns the all the elements.

How can I know from the json(which property) that the field “voltage:33” is the only field that have changed values(the user has entered new value, not pressed Submit button yet).
I cannot find any specific/special property that exists in voltage( the value changed field), that doesn’t exist in other ‘unchanged’ fields.

(is it the “disabled” property? cannot find it among other ‘unchanged’ fields.)

Goal is to send a get request (with the changed value as parameter) as soon as user edits a field…

1 Like

You can use context.element. Also you can compare elements values and context.panel.initial to find changed values and send them

1 Like