IMPORTJSONAPI icon indicating copy to clipboard operation
IMPORTJSONAPI copied to clipboard

request to add type for 'image'

Open frankis opened this issue 3 years ago • 1 comments

Since gSheets allows inline images, could you please consider adding a type for those or adding an option to show the URL +adding a column for the image itself?

=IMPORTJSONAPI("https://autocomplete.clearbit.com/v1/companies/suggest?query=microsoft","$[0]","domain, logo")

  1. Option convert type to 'logo': A2 would then show the imamge instead of the URL
  2. Option keep image URL + add column next to it containing the image =IMAGE(A2) (if possible even with parammeters? =IMAGE(A2,4,100,100)

BTW: Thank you for sharing this code at all. It's a massive time saver!

frankis avatar Apr 19 '21 07:04 frankis

I looked into this and I don't think this is possible. The function can only return plain data types such as strings, numbers and dates. There is no functionality to return an image type or to set formulas (as far as I'm aware). See https://developers.google.com/apps-script/guides/sheets/functions#return_values

The best option is use another custom function such as described in the link below and run it from a custom menu so that it is able to directly manipulate cell data. https://webapps.stackexchange.com/questions/74508/how-to-display-image-from-url-in-google-sheets-and-apply-it-to-multiple-rows

qeet avatar Apr 22 '21 08:04 qeet