Retrieve images in cells using Google Sheets API

前端 未结 1 356
情深已故
情深已故 2020-12-17 05:38

I\'m using the Google Sheets API to return the JSON of a Google Sheet,

e.g

 var url = \'https://spreadsheets.google.com/feeds/list/\' + id + \'/od6/         


        
相关标签:
1条回答
  • 2020-12-17 06:28

    This is possible if you use Sheets API v4. If you make a spreadsheets.get request you get access to the =IMAGE(...) formula used in the cell.

    GET https://sheets.googleapis.com/v4/spreadsheets/{SPREADSHEET_ID}?
        includeGridData=true&ranges={RANGE_A1}&
        fields=sheets%2Fdata%2FrowData%2Fvalues%2FuserEnteredValue
    
    200 OK
    
    {
      "sheets": [
        {
          "data": [
            {
              "rowData": [
                {
                  "values": [
                    {
                      "userEnteredValue": {
                        "formulaValue": "=image(\"https://www.google.com/images/srpr/logo3w.png\")"
                      }
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
    
    0 讨论(0)
提交回复
热议问题