Append Table Rows to Docs using data from Sheets?

Skip to first unread message

Diana Ramos Fusther Correa

Jan 25, 2023, 3:50:18 PM1/25/23
to Google Apps Script Community
I am trying to do a report automation using Google Sheets data.
I have a set of Issues that are already filtered by Priority and Category. In Google Docs I would like to make a table per catergory where these issues appear sorted by priority.

This is my Google Doc Template (needs to fill in, as I'm unsure of how to continue)

Screenshot 2023-01-25 144720.png
And in google sheets I already have an Array filled with my Filtered Issues.
Screenshot 2023-01-25 144915.png

Does any one know a tutorial or a way to append these rows into the separate google docs table? I'm lost right now on how to proceed with this.

Thanks for all your help!

Jan 26, 2023, 6:12:33 AM1/26/23
to Google Apps Script Community
I have found, with much hand wringing and gnashing of teeth, that instead of trying to edit a table in a Doc, it is much easier to just build your table and insert the table into the Doc as a new Table (very first example at the top of the Table info) especially since you already have the table built (as your array). Simply make it a 2-D array ([your_array] becomes [[your_array]]), then you can easily style the table using table.setAttributes().
Reply all
Reply to author
0 new messages