Mastering Dynamic Data: A Comprehensive Guide to Creating Tables in Google Docs for Make.com Users

Hey there, Make.com users! Today, we're going to tackle a common problem many of you have been facing: creating a table in a Google Doc from an array of information. This can be particularly tricky when you're dealing with dynamic data, such as multiple products in a purchase order. But don't worry, we've got a solution for you!

Step-by-Step Solution

First, let's understand the problem. You have a purchase order template in a Google Doc. When someone places an order on your site, certain fields are populated on that template. The challenge is when the order contains multiple products. You need to take those items and insert them into a table in the template. The table has a Product Name, Quantity, Price, and Subtotal.

Here's how you can solve this:

  1. Use the "Google Docs → Make an API call" function. This allows you to create a table of five rows and four columns by calling POST /v1/documents/{{documentID}}:batchUpdate with a specific payload.
  2. For each of the purchased items, make an InsertTableRowRequest in the same way as the previous step. The payload would, of course, be different.
  3. If you're familiar with HTML, you can place a set variable between your iterator and text aggregator. This will allow you to do the HTML for each row. However, you won't be able to use the Create a Document from a Template function. Instead, you'll have to use the Create the Document module.

Troubleshooting Tips

If you're having trouble getting the Make and API call to work with a Google Doc module, don't worry. It can be a bit tricky. Here are a few tips:

  • Make sure you're using the correct document ID when making the API call.
  • Check your payload to ensure it's correctly formatted.
  • If you're still stuck, try looking at some example blueprints to see how others have set up their API modules.

Summary

Creating a table in a Google Doc from an array of information can be a bit challenging, especially when dealing with dynamic data. However, by using the "Google Docs → Make an API call" function and making an InsertTableRowRequest for each item, you can easily solve this problem. Remember, if you're familiar with HTML, you can also use a set variable to do the HTML for each row. Happy making!

You do have further questions?

Ask your question via E-Mail: Richard@make-app.de
Book a paid Support & Consulting Session
New Make.com user? Sign up through this Affiliate Link to receive 10.000 operations for FREE.