Possible to add a number of images to a google doc template?

Hello there!

I was having a look at this and I could not find a way to add a number (not known number, always variable) of images into a document section in a google doc template.

For example, I would have a step that receives a list of image URLs to add in the document, and where to add that in the document, and then I’d like to add every single image to the document.

Do you know if this is possible today and perhaps some hints to help me move towards the right direction?

Thank you in advance!

Enrico

Yes, use the Google Docs “Insert An Image” module.

Assuming the URLs are in an array, use an Iterator to iterate for each image URL, and then feed it into the GDoc module. You can specify in that module where it should insert those images. The image URL variable from the Iterator can be set in the GDoc module. That way, it’ll repeat it for every image URL given to it.

1 Like

Thank you!

I’ll try to do the iteration. My problem with the “Insert an Image to a Document” is that you have to find the “Index” which seems to be the number of chars after which to add the image.

How can you find that, for a specific point in the document?

You can use the Get a Document module and find your document, this then provides an array of the document contents, including the indexes of each element of the document. So you can then use that to specify the index you want in the next module.

1 Like

Hey @Anonymax

Thanks for your hints.

I don’t seem to find a good way to “find” something within the document with Get a Document.

Example:

What could I use to find “[[images]]” within that complex structure? And then determine its index? Is it possible at all?
I tried the text parser but reading the docs and attempting to use it, did not bring the hoped result. Ideas?

And when I try to hardcode the index for now, with Insert Image, I get an error if the images are not publicly available. Is it only possible to add images publicly available? Couldn’t the image come from another connector (eg: Google Drive itself, or Dropbox or whatever)

See error:

Screenshot-2023-05-04-14:20:24

Any workaround that you can think of?

Thanks!

Does anyone have ideas on how to move this forward?

Thanks again!

It needs to be a publicly accessible link directly to the image. You can use modules on Google Drive to get a share link for an image, and with other file hosting apps too. You could try passing it image data but it’ll likely not work or consume too much data

1 Like