Search code examples
google-apps-scriptgoogle-sheetsgoogle-drive-api

Can privates images on Google Docs be linked into Google Sheets programatically?


I have a series of images that need to be private and only viewable within our Google Domain. If the image is shared publicly (Anyone on the Internet with this link can view), I can view the image in a Google Sheet using the =image() function, but with the image being private I cannot use the =image() function, which is an expected feature.

Google - Image Function

I am aware that the use of Google Drive as a "web host" has been depreciated, and with this the ability to link to a private document also seems to have been removed.

Deprecating web hosting support in Google Drive

I can manually go via the Insert | Image route and insert a private image into a cell. This allows the image that is private within our domain to be visible in a sheet. I have not been able to find any way to replicate this functionality in a app script. Manually undertaken this work for what I need would be to labour intensive.

Google - Add an image to a spreadsheet

I am also aware that the insertimage() function allows the import of a private file into a sheet, but this function does not import the image into a cell but over a cell and that the functionality to do this doesn’t currently exist.

Inserting Images into a Sheet as BlobSource using Google Apps Script

Google Issue Tracker - Insert Image into Cells

As far as I’ve been able to see there is no specific way of using a private file in Google Docs, on a Google Sheet either via an apps script or via built in functions.

If I am able to confirm that there is no possible way of doing this I can then investigate other options, but I have been unable to find a definitive YES/NO statement that explains that the use of private images in a Google sheet can be seen.


Solution

  • I agree with @AaronDuniganAtLee. You already have done sufficient research to confirm this.

    Given that there are also mentions of the feature request Google Issue Tracker - Insert Image into Cells on several Stackoverflow posts like Insert Image into Spresheet Cell from Drive using Google Apps Script & Google Apps Script - Insert Image into Spreadsheet cell using Google Drive ID about this matter & given this request is active in a P2 priority on Google Issue Tracker site, then the answer is No.