gameonly308
Thành viên hoạt động



- Tham gia
- 4/5/09
- Bài viết
- 197
- Được thích
- 10
Chào mọi người, hôm nay em có 1 đoạn code upload file lên google drive và add link vào sheet.
Giờ em muốn nó chỉ add link vào 1 Cell "A10" cố định thì làm thế nào ạ, mong mọi người ai biết tư vấn giúp em với.
Giờ em muốn nó chỉ add link vào 1 Cell "A10" cố định thì làm thế nào ạ, mong mọi người ai biết tư vấn giúp em với.
Mã:
function showDialog(){ //for show the msg to the user
var template = HtmlService.createTemplateFromFile("popmsg").evaluate(); //file html
SpreadsheetApp.getUi().showModalDialog(template,"File Upload"); //Show to user, add title
}
function uploadFilesToGoogleDrive(data,name,type){ //function to call on front side
var datafile = Utilities.base64Decode(data) //decode data from Base64
var blob2 = Utilities.newBlob(datafile, type, name); //create a new blob with decode data, name, type
var folder = DriveApp.getFolderById("1fJ1P8olhHCaoeoecDuVjtNEwGuqNuyRl"); //Get folder of destiny for file (final user need access before execution)
var newFile = folder.createFile(blob2); //Create new file (property of final user)
var rowData = [ //for print results
newFile.getUrl()
];
SpreadsheetApp.getActive().getSheetByName("Sheet1").appendRow(rowData); //print results
return newFile.getUrl() //Return URL
}