How to replace an image in Google Docs?

Hello everyone!
I understand there is a dedicated method for this operation (Requests  |  Google Docs API  |  Google Developers), but how to set it up with http request node, I didn’t figure it out.

Also found an example solution in the community (Uploading Images to Google Doc - #4 by The_Leading_Practice), but could not reproduce the provided sample code.

Can anyone suggest how to replace an image in Google Docs?

Hi @Roket, n8n doesn’t currently have an option for replacing (or inserting) images in the Google Docs node I am afraid.

So in order to achieve this with the currently available options, you would need to research the required API requests from the Google Docs’ API documentation and then fire the required requests through the HTTP Request node.

Alternatively, I can convert this question into a feature request for you, so other community members can vote on it and the idea can be considered for implementation in n8n.

@MutedJam, hey! Thanks for the feedback!

In general, I am now solving the problem of creating dynamic templates based on Google Docs.

I need to solve the following:

  1. How to replace an image?
  2. How to dynamically add rows and columns to a table with different content: text, image (that is, when you need to add arrays of related data with the main object)?
  3. How can I hide parts of the template that I don’t want to be rendered based on some of the properties of the objects received in the Webhook node?

I’m an experienced app maker at Appsheet.com, they have a Google Docs template creation feature (Template Start Expressions | AppSheet Help Center). There is a simple standard syntax, but in the framework of n8n one would think that this could be done differently (for example, replace the expression syntax with an array of objects = an entire table or something similar). In general, in order to preserve the advantages of two systems (n8n - working with data, Google Docs - a convenient visual editor).

Due to the prevalence and ease of working with Google Docs, this solution would be ideal.
Can you create a feature request like this?

2 Likes

Thanks so much for elaborating here! I have now marked this topic as a feature request, don’t forget to vote on it :slight_smile:

2 Likes

Hello,
This request seems old. I would like to know if a solution exists to replace/add an image in a Google doc (or other type of document).

I have a client who signs via an app, and I would like to generate the contract using a webhook and send it information and the signature.

Do you have an idea?

1 Like

any update for replacing image method?