Bulk Update Table Records

Hi,
I have this working on the old version of Retool tables, but not in the latest version.

I want the user to select multiple rows in a table.
Then using a dropdown the user selects which column he wants to bulk update.
Then the user enters in a text box the text that should be applied to all the selected rows.

But I'm getting this error:


Cannot read properties of undefined (reading 'map')

How to I update my Js to work with the latest tables?

Thank you
Tanguy

Hi @Tanguy,

I think you need table6.selectedRows.map - plural, not selectedRow.map.

See if that works?

1 Like

@MikeCB Thanks for the tip! In case anyone else needs this thread later this is how I'm doing bulk update for users selecting multiple rows in a table:

  1. I've created a dropdown menu for the user to select which column they want to edit : select4
  2. I've create a text entry box for the user to enter what is the text they wish to have inputted on all the selected rows: textInput3
  3. Create a button (I've named it "Bulk changes") this triggers the bulkupdate Js query:

let col = select4.value
let value = textInput3.value

return table6.selectedRows.map(item => {
return {
...item,
[col] : value
}
})

  1. Upon success the Js query will execute a Save query, with the code:
    {{bulkupdate_overcharge.data}} which refers to the Js query in the previous step

1 Like

Hi @Tanguy, thank you for adding the settings that made this work. This will help other users running into a similar issue.