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!
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.
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.
Thanks for your hints.
I don’t seem to find a good way to “find” something within the document with Get a Document.
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)
Any workaround that you can think of?
Does anyone have ideas on how to move this forward?
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