- I am building a
Container Bound Script
usingAppsScript
wrtGoogle Sheets
. - I am taking input by adding a menu on the google sheet as shown below,
- And when clicked, prompted with a HTML form, in which we can upload a PDF, which is saved on
Google Drive
and the information regarding the file upload in saved on the google sheets, but I also want to send to aFastAPI
running locally on my machine.
- File Information stored on Google Sheets
- Code for saving on Google Drive
function uploadFilesToGoogleDrive(data,name,type){
var datafile = Utilities.base64Decode(data)
//create a new blob with decode data, name, type
var blob2 = Utilities.newBlob(datafile, type, name);
var folder = DriveApp.getFolderById("<url>");
//Create new file (property of final user)
var newFile = folder.createFile(blob2);
var rowData = [
newFile.getName(),
newFile.getUrl(),
newFile.getDateCreated()
];
SpreadsheetApp.getActive().getSheetByName("sheet1").appendRow(rowData);
return newFile.getUrl()
}
- For sending data to external API I came across Run app script function from website/localhost and Upload files from google drive to external api using google apps script
- I am not getting a method through which I can send to API running locally without
localtunnel
.