Array of up to 6 text data into 1 Google Docs document

Hello!

I’m trying to insert an array of 6 words into a Google Docs “Create a Document from a Template” module. The document is pulled out of my Google Drive. I want them to appear in the following format within the document, which is within a table:

Column 2
markText0
markText1
markText2
markText3
markText4
markText5

If there are only 4 items, then it should only go down to 4 and not leave lines beneath it on the document.

On my Google Docs document, it is formatted as below:

Column 2
{{words-1}}

I have tried to learn and use the iteration functions, however this (perhaps expectedly) just creates 6 separate documents with a different item in each.

I also tried a more basic way of NOT using an array, and having the items send as individual data from the webhook, and using If functions as seen below:

Because of Google Docs’ lack of formula/function compatability, I couldn’t get this method to remove the empty lines either if only markText1 and markText2 hold data.

Does anybody have any ideas? Either with setting up the array correctly or editing the more basic if function methods?

Thanks in advance! :slightly_smiling_face:

Hi CharIotte,

You can try this approach.

  1. Add all required values to the array and add the array to an Iterator.
  2. Set up the filter that only processes existing values.
  3. Aggregate the values into a text using the Text Aggregator module.

I have attached a blueprint of this setup below.
blueprint.json (4.0 KB)
You can import it to a draft scenario and copy it into your flow.

1 Like

Welcome to the Make community!

You can use the Google Docs “documents.batchUpdate” endpoint with an “insertTableRow” request to add as many rows as you need after the “Create a Document from a Template” module.

For more information, see

This won’t work, because the content is going to be inserted into individual cells in table rows.

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.

2 Likes

@samliew, you are right. I misunderstood the question.

1 Like