**NEW** IMAGE() URL Fetch Error

468 views
Skip to first unread message

SilverBullet App

unread,
Feb 6, 2024, 5:47:23 PMFeb 6
to Google Apps Script Community
Hey Everyone- Hoping someone else has experienced this and has workaround, or knows how to escalate to Google for a fix.

I use apps script to create a backend Google sheet from a template and then build proposals (PDFs) using images store on the cloud (Cloudinary hosting).  This is all automated with the end users never actually opening up the sheet. Been doing this for many years without issues.

Starting a week or so ago, I am intermittently getting errors in some sheets (no commonality) where the image fails to render, instead showing #REF!.   When the sheet is opened, you see a message stating "Warning: Some formulas are trying to send and receive data from external parties" and if you click on the IMAGE() field you get an authorization modal stating "You must allow access to fetch data from external URLs for all IMPORTHTML(), IMPORTXML(), IMPORTFEED(), IMPORTDATA(), IMAGE() functions in this spreadsheet" 

After authorizing the image again renders, but I've now seen the issue return to previously authorized sheets. This is causing major issues to our service.  

Does anyone have ideas for how to programatically authorize a sheet, or somehow update settings to remove the need to do this ad hoc?  Thanks so much to anyone who has ideas.

Best,
Peter
image import warning.png

Rex Schrader

unread,
Feb 8, 2024, 2:19:16 PMFeb 8
to Google Apps Script Community
I have an almost identical problem. We're programmatically building labels in Google Sheets with QR Codes which reference a QR Code creator on our website. We just printed a huge batch of labels which didn't render the QR Code because of this warning.

I'm very much looking for a solution to this, but this is the only reference I've seen to the problem anywhere online.

Riël Notermans (Zzapps)

unread,
Feb 8, 2024, 2:23:00 PMFeb 8
to Google Apps Script Community
Interesting, but authorization can always be undone, e.g. on a password reset or a user removing the access.

Your script needs these auths. Have you considers creating an editor addon for it to handle the auth status?

Op donderdag 8 februari 2024 om 20:19:16 UTC+1 schreef Rex Schrader:

Rex Schrader

unread,
Feb 9, 2024, 2:36:46 AMFeb 9
to Google Apps Script Community
FYI, it looks like I came up with a solution that worked for me:
https://spreadsheet.dev/insert-image-in-cell-google-sheets-apps-script

You can embed the image into the cell using a `newCellImage`. It takes a URL, but doesn't have the same external error warning. I was able to exactly replace the code which set the `IMAGE()` formula with code that inserted the newCellImage.

Hope that helps!

On Tuesday, February 6, 2024 at 2:47:23 PM UTC-8 SilverBullet App wrote:

SilverBullet App

unread,
Feb 14, 2024, 6:39:58 PMFeb 14
to google-apps-sc...@googlegroups.com
The issue is that the user is not ever accessing the sheet (it's the backend to a web app)  The sheet is just being utilized to build a PDF, with the images being dynamically set based on settings within the Web App.  It appears that once the sheet is authorized once it continues to work fine.  The problem was Google decided to roll this one in some random fashion where only 20% of my users initially needed authorization.  Now it appears 100% are requiring it.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Script Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-script-community/ihna0293kSY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/506525d8-4859-4b93-a5f2-5827938ec68fn%40googlegroups.com.

SilverBullet App

unread,
Feb 14, 2024, 6:43:41 PMFeb 14
to google-apps-sc...@googlegroups.com
Thanks Rex.  I was considering if I needed to go this route.  I was trying to avoid it since it would require additional server time in building out the PDF from a sheet if I needed to insert multiple images before URL Fetching the PDF.   For the time being, I've manually authorized all my users back end sheets and it appears that once the sheet is authorized it does not require any further authorizations. 

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Script Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-script-community/ihna0293kSY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-script-c...@googlegroups.com.

--Hyde

unread,
Feb 17, 2024, 8:52:43 AMFeb 17
to Google Apps Script Community
See issue 324798866 in the issue tracker. Click the +1 button in to top right-hand corner to vote for fixing the issue, and click the star icon ☆ in the top left-hand corner to get notified of status changes.

Please do not post a "me too" or "+1" reply, because that spams the inboxes of everyone who has starred the case. Just click the +1 button and the star icon. Google prioritizes issues by the number of votes, not by the number of comments.

Cheers --Hyde

Reply all
Reply to author
Forward
0 new messages