Hey there!
-
Goal: I am building an App, which is mainly for editing data from a Django Database. The table is filled by filling a database table in Retool through a workflow. The problem is, every row is getting assigned an ID during import. When creating a new row in my table component, I am not able to store it through the save handler, since it doesn't have an ID automatically generated, the primary key field "ID" is not editable in the component and can't be set as editable.
-
Steps: I tried adding a rowId by getting the max ID from the current table and adding it inside the save handler like this:
{{ table.newRows.map(x=>{
x.row_id= getMaxRowId + 1
x.updated_by= current_user.fullName;
x.updated_at= moment().format("YYYY/MM/DD HH:mm");
x.status= "Updated";
x.status= "New"
return x}))}}
The save handler is set to upsert, but it seems not beeing able to fill the row_id for me.
Thank you for the help!