I am trying to extract from the Get Google Document module output bundle the startIndex and endIndex of every element that contains a link textStyle equal to a specified url. The structure (part of it) looks like this:
In this example, i want to get the value of startIndex 1827 and endIndex 1867 by identifying the link url as gotomarket.global/events/innovaud-life-sciences-uk-mission-432-433/
I am guessing there may be a way to parse the get document output or perhaps even i can use a basic Docs API get document request and in the query specify a filter? But i dont really know the syntax and even if i get a smaller file, it will stil lneed parsing to extract the required data.
BTW the ultimate aim is having got the start and end indexes i can then use the batchUpdate method to change the URL. That’s the end goal.
Then with the filter, I can’t seem to travel down the branches far enough. I set the iterator to run through the content array to get some data and then to set a filter i hit the buffers here:
You might see a little popup in the bottom right corner saying “Refreshing Metadata” sometimes. Then the output of modules is being updated. In this example it indeed is rather odd, that the textStyle etc. isn’t being parsed. Maybe it’s because you chose paragraph instead of elements? Or Do you need to go through the paragraphs and then within each paragraph go through every element? → in this case you’ll need a second iterator
To specify the URL manually you need to use {{ }}
I think it’s {{37.textRun.textStyle.link.url}} (if you iterate through the elements array!)
You added “only links with URL www.abc.com” → adjust the filter “url = www.abc.com” instead of “url exists”
Given the output of the module you’ll probably need 3 iterators
iterate through the content array
2.iterate through the paragraphs of a content
Hi Richard, this works perfectly now. I can’t thank you enough for your support. Let me know if i can help you in any way. My work supports companies looking to internationalise.
BTW, is there a way I can share the scenario for others to access and learn? And do i now close this and mark it as SOLVED as I have seen in other commnity apps. And if so how?