Google Drive
Access specific folders or files in Google Drive, requiring version 2.1.20230130 or above
File ID
Specify the ID of a Google Drive folder or file, supporting the %FILENAME% variable.
Input Object
Represents a Google Drive object with a specified File ID. If it's a folder object, it supports asynchronous functions such as list(), upload(filename), createFolder(foldername), and createSpreadsheet(filename). If it's a file object, it supports the asynchronous function download(filename), and moveto(folderID).
// When the specified File ID is a folder, list all objects in this folder and download all files
let items = await input.list()
console.log(items)
// When an object supports the download(filename) function, download the file objects within the folder
for (const item of items) {
if (item.download) await item.download()
}
// When the specified File ID is a folder, upload a file from the workspace.
let file = await input.upload('image.jpg')
console.log(file)
// When the specified File ID is a folder, create a subfolder named 'subfolder'
let folder = await input.createFolder('subfolder')
console.log(folder)
// When the specified File ID is a folder, create a Google Spreadsheet file
let file2 = await input.createSpreadsheet('mysheet')
console.log(file2)
// When the specified File ID is a file, download this file to the workspace
await input.download()
// Move the file to another folder
await input.moveto('folderIDXXX')
--
We are dedicated to improving our content. Please let us know if you come across any errors, including spelling, grammar, or other mistakes, as your feedback is valuable to us! 🤖️⚡️
Last updated