How to edit and save rows from table

Hi, It is my first app and i'm learning programming so I may need extra help on the resolution !

I want to be able to edit one or more rows in my table then apply the changes using the save button.

The query i'm using to populate the table is the following:

  "Volumes"."Description" AS "VolumeDescription",
  "Locations"."Description" AS "LocationDescription",
  "Inventory" AS "Inventory"
  LEFT JOIN "Customers" AS "Customers" ON "Inventory"."CustomerID" = "Customers"."ID"
  LEFT JOIN "Volumes" AS "Volumes" ON "Inventory"."VolumeID" = "Volumes"."ID"
  LEFT JOIN "Locations" AS "Locations" ON "Inventory"."LocationID" = "Locations"."ID" 

I don't have a clue on what to write in my query to save the changes made to any of the columns
Ex : If I change the Customer (Client) and the Volume for multiple rows and click save. I want the rows to be updated in the DB (retooldb)

Welcome to Retool (and programming in general)!

Your case is a pretty straightforward one for many use cases in our apps. If you intend to allow for multiple rows to be updated the GUI action you want to use is Bulk Update via Primary key (but this also works for a single row):


This lets you choose your table's PK directly (which I believe you currently have hidden from your table display). The Array of records to update will be your table's changesetArray, which can be accessed using {{yourTableName.changesetArray}}

Lastly, sometimes you may need to send all of the row data to the query to be able to access unique values/columns, in which case you can toggle that option on in the table's Interaction setup:




It does work for all fields except the those using foreign keys.
Here's some row of my database

When I try to save it is returning the customer name and not the ID !

What should I do ?