Issue saving table cell change to db postgresql

Hi i got this issue

when i edit a cell (all column are editable) im calling this JS

if (table5.changesetArray.length > 0 ) { // only run if there actually is a change
  await telefonoemail_guardar.trigger() // Update database
  await telefonoemail.trigger() // requery
  await table5.clearChangeset() // Run last or else the old value may pop back in briefly.

but the issue is that sometimes it takes the change to db and sometimes it shows me this error:

An empty list of updates were applied.

    • statusCode:422
    • error:"Unprocessable Entity"
    • message:"An empty list of updates were applied."
    • data:null

not sure why it doesnt always works? any tips?

I already got a event on Change Cell to call that JS, if i remove that event and run it manually, works good. what im doing wrong?

thank you

Hi, Can you test these steps?

  1. edit the cell and click somewhere else, what happen?
  2. edit the cell and press enter, what happen?
1 Like

Also where the error is shown?

1 Like

i got on change cell event so it will always run query JS

{"status":422,"message":"An empty list of updates were applied.","statusCode":422,"error":"Unprocessable Entity","data":null,"queryExecutionMetadata":{"estimatedResponseSizeBytes":112,"resourceTimeTakenMs":3,"isPreview":false,"resourceType":"postg...

error happens in both cases, the only way to make it work is running everything manually

try using the "Run script" option in Change Cell Event Handler

this works very well for me

1 Like

Loom | Free Screen & Video Recording Software | Loom a video to see what is happening.

im on self host just in case its a bug or something

I got the error, but i was spamming "enter" and changing cells

1 Like

im just using one enter and thats it, as client likes to press enter, so its a bug?

can you try set clearChangeset on success telefonoemail_guardar?

its not consistent Loom | Free Screen & Video Recording Software | Loom sometimes works , sometimes dont

it seems like the query is attempting to update before transformer2 returns any data

how is transformer2 structured?

1 Like
let data =  {{table5.changesetArray}}
let id = {{}}
let fecha_actualiza = {{"America/Panama").format() }}

return => {
  return Object.assign(row, {
    "fecha_actualiza": fecha_actualiza,
    "usuario": {{current_user.firstName}}

you can set a debounce of 100ms in the change cell event, it will give the enough time to the transformer to update with the changesets,

i had the same issue but with the save action

1 Like

so this is a delay basically, as my db is locally, it should be quick, or maybe a overhead from retool

With debounce works great thank you!

1 Like

the problems seems to be the transformer not having the enought time to return the updated values

the query is triggering right after the change is made, so transformer is indeed returning the data but after the query has been triggered

1 Like

so db is quick than the transformer :stuck_out_tongue: thank you!

maybe, your welcome :+1: