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.
-
Updated the db to insert a (dash) - in each previously empty cell.
-
changed key value fields as from this post.
Working with empty input components
for example,
from {{form_textInput2.value}}
TO
{{form_textInput2.value===''? null : form_textInput2.value}} -
Inserted the transformer code from this post: How to replace empty strings with null in table.recordUpdates
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