I am capturing the URL (along with additional information) in a Form. That form exports to a Sheet which triggers GAS that finds/replaces placeholders in a Doc template with information in the Sheet. What I would like to do is replace the URL in the doc after the first GAS runs with a second one that only captures the URL, pulls the image and replaces the URL with that image.
The DocID will never be the same. My thought is to associate the GAS with the template file which is used to create all Docs so it will (should?) be associated with all copies. I hope that makes sense. Thank you for any information you can pass along!
//logo URL coming from Sheet
var logo = e.values[4]; // fetching the image from the URL
var response = UrlFetchApp.fetch(logo);
var fileBlob = response.getBlob();
var res = ImgApp.getSize(fileBlob);
Logger.log(fileBlob); //Attempt to get image into document
body.replaceText('{{blob}}', fileBlob);