Mastering Make.com: A Comprehensive Guide to Extracting Data from Google Document Module Output Bundles

Hey there, Make.com users! Today, we're going to tackle a common problem that many of you might have encountered: extracting specific data from a Get Google Document module output bundle. Specifically, we're looking at how to get the startIndex and endIndex of every element that contains a link textStyle equal to a specified URL. Sounds complicated? Don't worry, we've got you covered!

Understanding the Problem

Let's say you have a Google Document with various links embedded in it. You want to find the startIndex and endIndex of every element that contains a specific URL. This information is crucial because it allows you to use the batchUpdate method to change the URL later on. However, parsing the get document output or using a basic Docs API get document request can be tricky if you're not familiar with the syntax.

Step-by-Step Solution

Here's a simple approach to solve this problem:

  1. First, get the output from your Google Document.
  2. Next, iterate through the elements array. You're looking for elements where the textRun.textStyle.link.url exists.
  3. Finally, use an array aggregator to collect the startIndex and endIndex of each element.

Remember, you're not looking for all links, only those links where the link.url matches your specified URL.

Troubleshooting Tips

If you're not seeing any output bundles, it might be because you're not parsing the textStyle correctly. Try choosing 'elements' instead of 'paragraphs' in your iterator. If you need to go through the paragraphs and then within each paragraph go through every element, you'll need a second iterator.

To specify the URL manually, use {{ }}. For example, if you're iterating through the elements array, it would be {{37.textRun.textStyle.link.url}}.

If you're only interested in links with a specific URL, adjust the filter to "url = www.abc.com" instead of "url exists".

Based on the output of the module, you'll probably need three iterators:

  1. Iterate through the content array.
  2. Iterate through the paragraphs of a content.
  3. Iterate through the elements of a paragraph.

If your array aggregator is showing more entries than expected, make sure you've chosen your first iterator as the "source module". This should fix any issues with empty output bundles.

Wrapping Up

And there you have it! With these steps, you should be able to extract the startIndex and endIndex of every element that contains a specific URL from a Get Google Document module output bundle. Remember, the key is to iterate through the elements array and use an array aggregator to collect the data you need. Happy coding!

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.