Pictures do not open in google sheets - google-sheets

So I received a google sheet file that has both text, links and pictures. However pictures are uploading randomly and there are always a lot of them that won't upload.
Google rep said this :
here is failsafe way to use images in google sheets
put images in a shared folder on google drive
right click images - & get sharable link
paste that link into cell - in example below column F5:F8
formula to put image in cell can be a single cell - or array formula in B5
for single image
=If(F5="",,Image("http://drive.google.com/uc?export=view&id="&mid(F5,34,33),2))
an arrayformula for a column of images
=Arrayformula(If(F5:F8="",,Image("http://drive.google.com/uc?export=view&id="&mid(F5:F8,34,33),2)))
But we did it this way so it isn't helping.

If you want to use IMAGE with pictures hosted on Drive, you have to keep in mind that «You can only use URLs that aren't hosted at drive.google.com. SVG file format isn't supported». Therefore, you can't use the hosted Drive pics into the formula. I was able to run your formula by using an image hosted outside of Drive:
=IF(F5="",,IMAGE("https://upload.wikimedia.org/wikipedia/commons/thumb/7/77/Variegated_grasshopper_%28Zonocerus_variegatus%29.jpg/1024px-Variegated_grasshopper_%28Zonocerus_variegatus%29.jpg",2))

Related

How to get websites logos with google sheets IMPORTXML with //img/#src?

I have a google sheet list with different companies and their website addresses. I am building a small app in glide and would like to include the companies logo. In my google sheet I want to have a URL to the logo image. Is there any way how I can filter out the other images, that I am getting with //img/#src? Please help me find the function for =importxml(E3,"//img/#src") -->get only logo.
Thank you for your help
my table
For the first one, you can use
=IMPORTXML("https://www.xolo.io/zz-en","//link[#type='image/png']/#href")
No possibility for https://1office.co/ (the website uses javascript)
Third one
=importxml("https://www.firma.de/","//meta[#property='og:image']/#content")
you have to retrieve the specific xpath for each url

Google Sheet Show Image

I'm currently having trouble displaying an image in Google Sheet. I have a Google Form template in which I'm using the FILE UPLOAD function, and I believe the image will be saved in Google Drive, correct?
The responses on the Google Form will be connected on a Google Sheet. So, using Google Sheets, I created a template in which I use the VLOOKUP function to display specific data. When I use the VLOOKUP for the image, it only displays the URL path. Is it possible for me to show it as the image itself?
Upon researching, it says that I need to use =IMAGE() to show an image. However, it seems that it is not working with the =VLOOKUP function.
This is the formula that I used =IMAGE((VLOOKUP(F2,AppData,2,0))) and it only gave me a blank cell.
SAMPLE SPREADSHEET
When VLOOKUP(F2,AppData,2,0) is the URL like https://drive.google.com/open?id=######, in your situation, how about using the following sample formula?
Sample formula:
=IMAGE("https://drive.google.com/uc?export=download&id="&INDEX(SPLIT(VLOOKUP(F2,AppData,2,0),"="),1,2))
or
=IMAGE("https://drive.google.com/uc?export=download&id="&REGEXEXTRACT(VLOOKUP(F2,AppData,2,0),"id\=(.+)"))
By this, the file ID is retrieved from your URL of https://drive.google.com/open?id=###, and the webContentLink is created.
Result:
When your sample Spreadsheet is used, the following result is obtained.
Note:
This sample supposes that your URL is like https://drive.google.com/open?id=###. If the URL is different, this sample might not be able to be used. Please be careful about this.
This sample also supposes that your image file is publicly sharead. Please be careful this.

Is there any API available for Retrieve images in the cell from a google spreadsheet?

I'm trying to Retrieve images in the cell from a google spreadsheet. I checked this question is already available. and I also referred to this documentation. But, these both are no longer work. Does anyone suggests me API or provides any good documentation link?
Edited:
This is my Google Sheet. I'm trying to retrieve A4 and A5. Which is I uploaded from local machine. I used this API. But It's given me the blank value. Is there any other API available for retrieving this both images?
You will not be able to retrieve images placed using the "Upload" functionality. To retrieve via API, the image should be placed using
=IMAGE("http://your.url").
So upload your image to a content server, get the URL and insert them to the respective cells using =IMAGE formula.
Now if you retrieve the grid data using Spreadsheet.get and locate this specific element in the array, you will get the cell value as =IMAGE("http://your.url"), you can parse this string to retrieve the image URL.
You can get a zip file with the sheet in html format with all the images – using Google API. I belive it will be easy to parse it and to get the image you need.
Get Your API Key, from Google developers Console
Get a File ID of a google spreadsheet with permissions set to "Anyone with the link".
Now you're ready to call the api (with curl or browser window):
https://www.googleapis.com/drive/v3/files/{FILE_ID}/export?mimeType=application%2Fzip&key={YOUR API KEY}
fill in your FILE_ID and API_KEY from google.
works only with "anyone with link" permissions, otherwise you gotta authenticate first. (more here: How to send google-sheet data in an email keeping the formatting( colors) intact from python?)

Extract data from Google docs to Google sheets

I am working within the same Google drive folder.
I have a number of Google Docs, which all contains a number of tables in the same format. What I want is to export the data from each table in to according rows in a google spreadsheet. I think the function should be automated to run ones every day. The first problem I am bumping in on is to open the different Doc files and extract the tables - any surgestions on how to do that?
The folder is access protected, but both the Docs and Sheet are placed within the same folder.
BR.
Torben
You will need to use the Drive API and export the documents as HTML. Then you will need to parse the HTML yourself to extract the table data. Finally use the Sheets API to insert that data into your spreadsheet.

How to extract url from Google Sheet Cell with anchor text hyperlink

I have copied a list of links from the web to a google spreadsheet.
Now there is a list of hyperlinked text in each cell.
I want to put the url underneath the anchor text into a new cell.
However, the only methods discussed online refer to how to get a url from a cell that is using the HYPERLINK() function. My cells are not using such a function, they are simply copied and pasted from a website, but still retain their anchor text and hyperlink. Other options use Macros/VBA, which I cannot use/have access to.
How can I replace these anchor text in a Google Sheets cell with the links they represent or copy them into a new cell?
This only a partial answer, but I spent an embarrassing amount of time recently trying to extract links from a spreadsheet that were done the way you describe.
The only way I was able to finally do it was to export the sheet as HTML, and use regex to find the hrefs and extract them.
Full discloser, my wife came up with this in about 10 minutes, meanwhile I wasted many hours playing with the Google Sheets API, Open Office, Excel, and various xlsx parsing libraries for Go.
Anyway - if you just need to extract the links, it's not impossible, but it's not very practical either.

Resources