Issues getting Gsheets to Update Properly

I feel I'm missing something simple but just can't quite seem to resolve. I'm trying to build a basic app that reads data from a gsheet, allows me to make edits/notes in a rich text field and then save those back to the gsheet.

I have 2 queries:

  1. query to read the gsheet data into a table
  2. query to fetch the text from richtextfield component and write back to the gsheet in updated cell.

my problem is with 2.

I've tried using the A1 notation and Filter Rows option to specify column that's then referenced in the update value field.

When I try using A1 notation, I receive errors that the field is invalid json object. I've had the most success using the Filter Rows option but when running the query, the update is made to ALL rows in the specified column "Notes". The ideal behavior is to update notes field of the specified row which I've tried to identify by table1.selectedRow.notes

To be clear, the ideal behavior is:

  1. select row from table
  2. update text in the rich text field
  3. run query
  4. updated text from rich text field is written to notes field in gsheet ONLY to the selected row from table.

example issue using A1 Notation

example issue using filter row (see the difference between runs)




Hello @hadenp92!

I think I found a working solution for how to only update a single cell in your Googlsheets.

In the Query to update, with A1 notation selected, you should you should preface the {{ }} with the column you want to update.

Since you have Notes as column S it would recommend trying this:

Sheet3!S{{table1.selectedDataIndex+2}}

Adding two will correctly offset the ROW you want to update. This is because if you select the top row in a retool table, table1.selectedDataIndex will return zero. You can play around with this as needed.

For "Values to update" I used [ {{richTextEditor1.value}} ] which was able to grab the rich text from the Retool component source.

Don't forget to add to your update queries Success event handler to run the first query!

You can read more about the Google Sheets API here as well, they have some useful examples for different ways to select rows and columns here