Category : google-drive-api

I’m using Google Sheets addon Autocrat to generate certificates & store them in the Certificate folder in my Google Drive. There are various other fields in my spreadsheet that gets updated in my MySQL Database automatically on Google Form Submission. I’ve used Google Apps Script to automatically upload my spreadsheet rows to MySQL Database. I ..

Read more

I want to create file copies in a bulk with one call, now I am using Google Drive Rest API for copying files. Code: copyFileCreation(_id, _fileId, _token) { console.log({ _id }, { _fileId }, { _token }); fetch(`https://www.googleapis.com/drive/v2/files/${_fileId}/copy`, { method: ‘POST’, headers: { ‘Content-Type’: ‘application/json’, ‘Authorization’: `Bearer ${_token}`, ‘Accept’: ‘application/json’ }, body: JSON.stringify({ "parents": [{ ..

Read more

So I have the script below which allows me to automatically create google drive hyperlinks of files within the same directory: function myFunction() { var ss=SpreadsheetApp.getActiveSpreadsheet(); var s=ss.getActiveSheet(); var c=s.getActiveCell(); var fldr=DriveApp.getFolderById(*[insert id]*); var files=fldr.getFiles(); var names=[],f,str; while (files.hasNext()) { f=files.next(); str=’=hyperlink("’ + f.getUrl() + ‘")’; str2 = f.getName(); names.push([str2,str]); } s.getRange(c.getRow(),c.getColumn(),names.length,2).setValues(names); } I am ..

Read more

I’m attempting to add a menu option in a Google Sheet that uploads a file to drive, then inserts a link to that file in the Sheet. I’m having problems with the upload function, called from HTML. Code.gs function onOpen(e){ Logger.log(‘Opened spreadsheet’); var ss = SpreadsheetApp.getActiveSpreadsheet(); var menuEntries = []; menuEntries.push({name: "File", functionName: "openHTMLUploadDialogue"}); ss.addMenu("Attach!", ..

Read more