I have a Google Doc which has linked cells to Google Sheets. I want to type a Script that automatically updates the document whenever the cells in Google Sheets are changed (it receives answers from a Google Form).
I'm New to scripts.
Thanks a lot.
Google-apps-script – Automatically update inserted sheets cells in Google Docs
google docsgoogle-apps-script
Related Topic
- Google Docs – How to Automatically Add Current Date to Document Footer
- Google Docs – Add Scripts or Add-Ons to New Document
- Google-apps-script – How to know what files on Google Drive (sheets, docs, slides) has GAS inside
- Google Sheets – Auto Update Cells with Timestamp
- Google-sheets – How to automatically convert all Microsoft Office file attachments in Gmail to Google Docs
- Google-sheets – Google Sheets Google Forms updates
Best Answer
This answer is based on the work of
user79865
.You have a Google Form which exports results to a Google Sheet; you have embeded the sheet in a Google Doc and you are looking for a way to update the Google Doc automatically whenever there is a new form response.
Your question is substantially answered in webapps question: Embed Google Spreadsheet table Withing Google Document when data contains dates which in turn was based on this webapps question Embed Google Spreadsheet in Google Document.
Your scenario differs in two ways:
1 - you want to update the Google document for every new form response, and
2 - you want the update to be automatic.
Installation
You have a Google Form, Google Spreadsheet and a Google Document.
Google Document
Google Form
Google Spreadsheet
var sheetName = "<<insert sheet name>>";
: edit the script to include the actual name of the sheet containing the form responses - (put the sheet name between the quotes)var docid = "<<insert document ID>>";
: edit the script to include the actual document ID - (put the ID between the quotes)Trigger
: from the menu, select "Edit, Current Projects Triggers". In the new tab that opensProcessing