I have created a form that takes some input.
At the end of that JS, I want to write resulting data into a currently selected row in a Google Sheets table - specifically update column4, column5, and column9.
What is the correct JS syntax to do this?
Or, should some data be passed to a second GSheets query for this update?
Hey @steve.b.c3 and welcome to the community! I would be remiss if I didn't link to a video we just made on this topic https://www.youtube.com/watch?v=9GcAEAuWUT8
To answer your question more directly - a table is just a frontend representation of your data, so you need to update the underlying resource that's powering your table. If it's Google Sheets, you'll want to create a query, choose "update your spreadsheet" from the dropdown, and fill in the requisite details. We have a tutorial for Google Sheets specifically here.
In terms of ordering, you can configure your new GSheets query to run after the JS query you've triggered - click on your JS query, scroll down to the "after this query runs" section, and choose your GSheets query in the "on success trigger" field. If you have a GSheets query that's populating your table, you'll probably also want to rerun that once the update is made.
Hope this helps!!
Here is my understanding of the steps:
- Form1 auto-populates with selected table row data
- User adds/modifies form data and hits submit
- Google Sheets Update query runs, updating the Google Sheet with passed values
- Google Sheets read query reruns to get newly updated data
- Table refreshes, showing updated data
Is that about right?
Exactly - but between 5. and 6., there’s 5a. Google Sheets read query reruns to get newly updated data.