3

I am currently using a script to automatically pull somebody's picture from my drive when they submit a form. I had been using the =image function of Google sheets coupled with the below script to achieve this:

function imageUpdate() {
var images= DriveApp.getFilesByName(name+" "+"Picture");
while (images.hasNext()){
var img=images.next();
var imgId=img.getId();
var pubUrl=baseUrl+imgId
}
if(imgId===undefined){
}else{
sheet.getRange("C5").setValue("=IMAGE("+'"'+pubUrl+'"'+")");
}

}

where baseUrl is defined globally by:

var baseUrl = "http://drive.google.com/uc?export=view&id=";

This script worked initially but then began loading images rotated 90 degrees anticlockwise, then not at all. The function is still being correctly loaded into the relevant cell in the spreadsheet, but only a blank white cell is appearing.

Any help would be appreciated.

Rubén
  • 34,714
  • 9
  • 70
  • 166
dbr
  • 661
  • 1
  • 8
  • 21

0 Answers0