Issue with Editable Columns in Table

Hello Retool community,

I'm currently working on a Retool application that involves two tables: 'tableVendors' and 'vendorContracts'. I'm facing an issue with the 'vendorContracts' table, specifically with editable columns.

Here's the setup:

  1. I have a table named 'tableVendors' that displays a list of all vendors.
  2. I've created a query called 'contractsByVendor', which retrieves data from a database based on the selected vendor's ID from 'tableVendors'.
    select * from marts.vendor_contracts where id = {{tableVendors.selectedRow.id}}
    The result of this is used as the data source for 'vendorContracts'.
  3. So the 'vendorContracts' table is set up to show dynamic data based on the vendor selected in 'tableVendors'.
  4. I've made the columns in 'vendorContracts' editable so that users can update data.

The problem I'm facing is that the columns in 'vendorContracts' are editable only for the vendor that was selected when I initially made the columns editable. When I select other vendors from 'tableVendors', the columns still appear editable, but no changes can be made.

I'm looking for advice on how to make the columns in 'vendorContracts' consistently editable for any vendor selected in 'tableVendors'. It seems that the editing functionality gets tied to the initial vendor selection.

Has anyone encountered a similar issue or have any suggestions on how to resolve this? Any insights or guidance would be greatly appreciated.

Thank you in advance for your help!

Do you want to update all rows at once? If so use Bulk Update.
After that runs the vendorContracts should be reloaded for all changes to be rendered.
I don't believe you can do both at once since the change is only in the table component itself and not the actual data in the db

I only want to update the row that is selected in 'vendorContracts' table.
I use insert a record as an action type, which works fine for that one specific vendor.

The problem is that I even can't enter new value to a column for other vendors. I mean that even when column is set to be editable it is not actually :thinking:

OK I see - so when you click the action button you want to insert the record with the change made in the vendorContractsTable

@ScottR, I think you do not understand my question. The problem I have is that I can't edit values in vendorContractsTable. Even if in the column settings I make the column as editable and in the table column I see "Enter value" I can't enter any values. It is not allowed.
I do not have any problems with the action button or the action itself.

You're right I didn't ... OK
Try resetting the state of the table?
Screenshot 2023-10-06 at 1.35.24 PM

1 Like

@ScottR thanks for your assistance.
Actually, the problem was the Primary key that I used - it was not unique.

1 Like