I use Data manipulation from Volkovlabs and now i want to update 2 tables in my mysql-database.
This is what i have tried
const payload = {};
elements.forEach((element) => {
if (!element.value) {
return;
}
payload[element.id] = element.value;
});
// Create a object for each SQL-question
const queryInsert = {
rawSql: `INSERT INTO anc_test_result (fid, result, comment, user) VALUES ('${payload.fid}', '${payload.result}', '${payload.comment}', '${__user.id}')`,
format: 'table',
};
const queryUpdate = {
rawSql: `INSERT INTO anc_test_status (fid, status) VALUES ('${payload.fid}', 'Test incomming') ON DUPLICATE KEY UPDATE status = VALUES(status)`,
format: 'table',
};
// Return a list with the separate SQL-question.
return [queryInsert, queryUpdate];
and when i run each of them separately they work.
Is this even possible to do?