What is your goal?
Link url to a title in Google Doc
What is the problem & what have you tried?
I have a module Google Doc Create Template and im trying to apply a Title with a link inside, is it possible?
Example: I want to link a url to a Title or specific text in google doc, so when i click on that title, it opens directly the link, video, image, website, whatever it is.
Hello,
I’m not aware of any other method than using the updateTextStyle request via the /batchUpdate endpoint.
You’ll need to make a custom API request using the Make an API Call module after the document is created.
The Google Docs API documentation is quite well written and known to LLMs, so tools like ChatGPT/ Gemini can help you generate the correct request structure.
Below you can find an example and a sample scenario.
The tricky part is that there is no simple “find and replace text” option in the API.
Instead, you must provide the text index .
As you can see in my example, the range is set to 1–23 , so only the first part of the heading is converted into a link rather than the entire heading. It can be achieved with built in Make.com functions to count length of URL.
Feel free to experiment with the scenario shared below. After importing it, just update it with your own credentials.
Example request:
URL:
/v1/documents/{{1.id}}:batchUpdate
Where {{1.id}} is ID of your Google Docs file
Method:
POST
Body:
{
"requests": [
{
"updateTextStyle": {
"range": {
"startIndex": 1,
"endIndex": 23
},
"textStyle": {
"link": {
"url": "https://simplymation.pl"
}
},
"fields": "link"
}
}
]
}
Have a nice day!