Home > Mobile >  Add link to new created file in Sheet
Add link to new created file in Sheet

Time:02-25

Hi I am creating a new pdf file and just want to insert a link to the new created file stored in my drive in a cell in my Sheet. What should I place in the setValue() to create the hyperlink straight to the created file in that cell? Thanks

    var pdfBlob = DriveApp.getFileById(slideFile.getId()).getBlob().getAs("application/pdf");
pdfBlob.setName(fileName);
pdfsFolder.createFile(pdfBlob);
Logger.log('Current Row: '   i)
ss.getRange(i 1,16).setValue(????)

CodePudding user response:

function test() {
  var i = 0;
  var pdfBlob DriveApp.getFileById(slideFile.getId()).getBlob().getAs("application/pdf");
  pdfBlob.setName(fileName);
  var file = pdfsFolder.createFile(pdfBlob);
  Logger.log('Current Row: '   i);
  ss.getRange(i 1,16).setValue(file.getUrl());
}
  • Related