Insert Text into table cells using Google Docs API
Pretty new here, but I'm encountering an implementation problem I need some help with:
I am building a Google Docs integration that involves programmatically creating a table and then mapping through an array of records to add the data of those records to the table cells.
I'm able to create a blank table and locate the start index of each cell to insert the data into, but when I try to use the insertText request from the docs and place the text in a specific cell I get the following error:
"Invalid request[1].insertText: The insertion index must be inside the bounds of an existing paragraph. You can still create new paragraph by inserting new lines."
I've tried the following
Simply inserting my text and hoping that each insertText request places text in a new cell
Adding '\n' at the start index of the cells
Creating the table with tableRows already defined (this error out as an invalid request format)
Creating cells one-by-one and inserting text after each appended 1x1 column or row (eventually you create a row that duplicated the row above it with multiple columns and all text would just be in the first cell)
Inserting Column breaks after the first cells text in hopes it would shift the paragraph over to the new cell