Hi.
I’m using Grafana Version 10.1.2 and Data Manipulation Plugin version 3.8.
I’m trying to get a user to fill out a form and upon submitting, displaying somehow the ID (privatekey) of that entry that was just created.
They way I’m trying to achieve this is as follows:
The user upon filling out the form, submits the data to a stored procedure that besides the input parameters, has one output that is the ID returned from that insert query.
What I would like to achieve is somehow retrieve that output parameter to a dashboard variable and than display it in the Success message.
I’m open to suggestions for a different way to accomplish this.
On the custom code that runs after an update request i have the following:
if (response && response.ok) {
notifySuccess([‘Update’, ‘Update success. New ID: ${id_generated}’]);
locationService.reload();
} else {
notifyError([‘Update’, ‘Error’]);
}
This code correctly displays the value stored on the dashboard variable “id_generated”.
My difficulty is getting the value from the output of the stored procedure into it.
My code for the update/insert query is as follows:
const payload = {};
elements.forEach((element) => {
if (!element.value) {
return;
}
payload[element.id] = element.value;
})
return {
rawSql: CALL insertQualidade(${payload.id_origem}, ${payload.peso}, '${payload.lote}', @${id_generated});
,
format: ‘table’,
};
Any help is appreciated.
Thank you.