What is the right way to put a Drive image into a Sheets cell programmatically?

前端 未结 3 473
春和景丽
春和景丽 2020-12-09 00:14

I have a WebApp that collects work site data into a Google Sheets spreadsheet and also collects work site photos into a Google Drive folder that I create for each job. Some

3条回答
  •  时光取名叫无心
    2020-12-09 00:59

    I made a two lines script to use the share link of an image in Google Drive.

    1. Go to Tools > Script editor.
    2. Copy, paste the following code
    3. Save
    function DRIVE_IMAGE(link){
      return link.replace("open?", "uc?export=download&");
    }
    

    Using the script :

    1. Copy the Get shareable link of your image in Google Drive (Maybe you need to set the share preference to Public on the web).
    2. Go to a Google sheets cell.
    3. Enter the formula

      =IMAGE(DRIVE_IMAGE("COPIED_LINK"))
      

提交回复
热议问题