Skip to main content

Google Drive

Add Query​

You can add a query step by adding a workflow to the page list.
When you select the Google Drive data source from the workflow step sidebar, the query input window appears.

google-drive

Actions​

List​

Retrieves the list of files and folders in Google Drive.

list

Parameters​

NameTypeDescription
List Target Folder (parentId)stringFolder ID to retrieve

Query Result​

When you run the Query action, the result is returned in the following structure.
GoogleDriveFile type is a type for Google Drive's file.
For more information, please refer to the Google Drive official document.

interface GoogleDriveFile {
id: string;
kind: string;
name: string;
mimeType: string;
}

type Result = GoogleDriveFile[];

Use Result​

To use the result in another step, write as follows.

return outputs.stepName.map((item) => item.id);

Upload​

Uploads a new file to Google Drive.

upload

Parameters​

NameTypeDescription
Upload File (file)FileFile to upload
Upload Folder (parentId)stringFolder ID to upload

Query Result​

When you run the Query action, the result is returned in the following structure.

interface GoogleDriveFile {
id: string;
kind: string;
name: string;
mimeType: string;
}

type Result = GoogleDriveFile;

Use Result​

To use the result in another step, write as follows.

return outputs.stepName.id;

Download​

Downloads a file from Google Drive.

download

Query Result​

When you run the Query action, the result is returned in the following structure.

type Result = string; // base64 encoded file binary data

Use Result​

To use the result in another step, write as follows.

return outputs.stepName;

Parameters​

NameTypeDescription
Download Target File (fileId)stringFile ID to download

Delete​

Deletes a file from Google Drive.

delete

Parameters​

NameTypeDescription
Delete Target File (fileId)stringFile ID to delete

Query Result​

type Result = Record<string, never>;

delete is an empty object.