Closed Filikin closed 1 month ago
@Filikin You can check in the Browser's Network tab the payload and response to troubleshoot the issue.
What do you see in the context.panel.response
object? Was it successful?
Thanks, the problem was that I was looking that the tutorials for V3 and had missed the significance of the query editor in the Update Request Payload section
All good now, the dashboard is updating the PostGres database
@Filikin Correct, Query Editor was introduced in v4 is a game-changer and provides better user experience than v3.
I have Grafana using on AWS with Business forms version 4.6.0 I created a simple form to allow a row to be created in the PostGres database that is the source for Grafana In the update request payload, I have the following code:
const payload = {};
context.panel.elements.forEach((element) => { if (!element.value) { return; }
payload[element.id] = element.value; }) const queryInsert = { rawSql:
INSERT INTO battery_locations (client_id, location) VALUES ('${payload.client_id}', '${payload.location}')
, format: 'table', }; console.log(queryInsert); return queryInsert;I can see from the console that queryInsert is {rawSql: "INSERT INTO battery_locations (client_id, location) VALUES ('EPS123', 'My Office')", format: 'table'}
but nothing is getting to the database.
Is there a log either in the plugin or Grafana that I can use to help debug the issue? Nothing appears in the AWS database logs.
I am making the assumption that this should work, based on the tutorial videos