Unable to update sql table via form

After many attempts, I have been unable to use a form to update a MySQL based table. The app reads the table, but will not update due to the "data null" error as shown in the screenshot. There are many cells with only a - (dash) but no empty or null cells.

I'm not very experienced, so maybe I just missed an obvious thing. IDK. Any help much appreciated.

The screenshot shows the current settings for the inputs and key value pairs and below that are the main things I've tried.

let tableData = {{table1.recordUpdates}};

// iterate through each row of recordUpdates
for (let i = 0; i < tableData.length; i++) {  
  // check each value in row object
  _.forOwn(tableData[i],function(value,key) {
  // replace empty strings with `null`
    if (value == "") {
      tableData[i][key] = null

return tableData

hi, welcome to the community

The lovely error messages from SQL are often a bit vague!

I'd first double check that your update statement is targetting the right record and using the correct datatypes for the columns they're updating - I can also see that you're filtering by entity_id but then also updating entity_id to a different value, not sure that's intended?

It could be that the retool gui is unable to update it's own primary key (i've never needed to or tried to do this) but if you can share a picture of the full changeset and the values it thinks it's updating that might help pinpoint the issue.