Data Manipulation plugin, Grafana and output parameter from procedure

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.

that is not possible unlees you save that output to a logging table maybe within the stored procedure unless it is already being stored to a table then query from that table to populate the dashboard variable

but again what do you need that value for?

What I am trying to do is, a user fills out a form. Uppon creating an entry with data in the database, the primary key which is auto incremented is generated. What i want is a way to give back the primary key assigned to that entry to the user.

1 Like