I’m trying to insert a table into a Google Docs. Because the Google Docs API is too complex for my skill level, I’m first creating the table inside an empty Google Docs using HTML.
How I’m wondering how to:
Determine the position in the second multi-page document where it is to be inserted.
The actual API call to insert the content of the first Doc.
Any experts on this around? I realize it’s more of a Google Docs than Make topic… Apollogies
Hi @Zbulo,
I’ve worked quite a lot with Google Docs but I have to admit I didn’t insert a table yet.
Usually the process you do seems quite logical. Try to create a template using variables {{var1}} {{name}}, {{price}}. You can then use “Create Document from Template” and fill in these variables.
To build the table rows, I’m looping through multiple Airtable records. I aggregator the HTML rows and insert them into the table that is part of the “Create Document from Template” step.
I’m failing at the second step, to pin point the location inside and insert the table from the first into the second document. Here I got stuck with the Google Docs API.
Okay, sorry! I see what you are doing there but on the screenshot there is only the first step which is successful?
So the issue happens after the screenshot?
Alright, I see.
How is the second document built or what is inside the second document? You said it’s multiple pages but do you have a variable within this document? How would you manually determine the position of the table within that document?
Is there something specific we can search for?
It’s a generic contract type of document filled with variables.
I can add whatever orientation point is easiest to discover by the workflow.
E.g. for example a chapter head with a certain number, title, symbol…
Open for any ideas.
But columns stay the same? Because I’ve looked into the documentation of Google Docs and it seems like you could have a table in the Document and then add/remove or update rows.
Yes, columns are static, yet the API is very complex for me to use and produce a myriad of errors I don’t manage to debug. In another thread, someone had the smart solution of reversing the content order, which appears to remove many of the pixel / placement issues.
After your text aggregator, you want to get rid of the Create a Document module.
Instead, use a Set a Variable module under the Tools pack.
Name your variable Table HTML, and have your crafted HTML variable as the value
Next, and this is directly in your second google doc (so outside of Make) , wherever you want the table to sit in the page, put a very unique text, maybe something like <<|TABLEINSERT|>>
Come back to Make, and after your Set a Variable module, you’ll use the Download a Document module