Procedures

Automation procedures in the Google Drive book.

The following documentation is for Google Drive v2.0.0 (BDK).

to copy an item to a folder

Copy an item to a folder

Input Concepts

Concept
Description
Type
Required
Default Value

item

The item (file or folder) to copy

google drive file reference or google drive folder reference

Yes

(no default)

The folder to copy the item to

google drive folder reference

Yes

(no default)

conflict behavior

The behavior to use on conflict scenarios. It should be one of the following values: ('fail', 'replace', 'rename')

text

No

(no default)

Examples

Copy an item to a folder

get a folder at "Folder1/Folder2"
use the above as the base folder
copy the uploaded file to the base folder

Copy an item to a folder with a conflict behavior

get a folder at "Folder1/Folder2"
use the above as the testing folder
get a folder at "Folder1/Folder2/Conflictive Folder"
use the above as the conflictive folder
copy the conflictive folder to the testing folder
    the conflict behavior is "rename"

to create a (folder) in another folder

Create a (folder) in another folder

Input Concepts

Concept
Description
Type
Required
Default Value

The folder to create the (folder) in

google drive folder reference

Yes

(no default)

folder name

The name of the (folder) to create

text

Yes

(no default)

conflict behavior

The behavior to use on conflict scenarios. It should be one of the following values: ('fail', 'replace', 'rename')

text

No

(no default)

Output Concepts

Concept
Description
Type

a folder reference to the created folder

google drive folder reference

Examples

Create a folder in Google Drive

Create a folder in Google Drive, with 'rename' as the conflict behavior

to delete an item

Delete an item (file or folder)

Input Concepts

Concept
Description
Type
Required
Default Value

item

The item (file or folder) to delete

google drive file reference or google drive folder reference

Yes

(no default)

Examples

Delete an item

to download a file

Download a file

Input Concepts

Concept
Description
Type
Required
Default Value

The file reference to the file to download

google drive file reference

Yes

(no default)

Output Concepts

Concept
Description
Type

answer

the file as an IO object

file

Examples

Download a file

to get a (folder) at a path

Gets a reference to a folder.

Google Drive allows for multiple folders with the same name in a parent folder. For now, as the blueprint interface returns only one reference, it is returning the first item on the returned list. In case there are more than one folder with the same name, an error will be raised. In the future, this may change to a list of FolderReferences.

Input Concepts

Concept
Description
Type
Required
Default Value

path

The path to the folder

text

Yes

(no default)

Output Concepts

Concept
Description
Type

a folder reference

google drive folder reference

Examples

Get a folder at the path 'The Folder/The Subfolder'

to get a (root folder)

Gets a reference to the root folder.

Output Concepts

Concept
Description
Type

a folder reference

google drive folder reference

Examples

Get a root folder

to get some (folder's items)

FILTER - CAPABLE

Lists items from a folder reference

Input Concepts

Concept
Description
Type
Required
Default Value

The folder reference from which to list the items

google drive folder reference

Yes

(no default)

Output Concepts

Concept
Description
Type

folder's items

a list of Items (file or folder) containing the items in the folder

google drive file reference or google drive folder reference

Examples

List items in a folder

to move an item to a folder

Move an item to a folder

Input Concepts

Concept
Description
Type
Required
Default Value

item

The item (file or folder) to move

google drive file reference or google drive folder reference

Yes

(no default)

The folder to move the item to

google drive folder reference

Yes

(no default)

conflict behavior

The behavior to use on conflict scenarios. It should be one of the following values: ('fail', 'replace', 'rename')

text

No

(no default)

Examples

Move an item to a folder

Move an item to a folder with a conflict behavior

to rename an item to a name

Rename an item (file or folder) to a given name

Input Concepts

Concept
Description
Type
Required
Default Value

item

The item (file or folder) to rename

google drive file reference or google drive folder reference

Yes

(no default)

name

The new name of the item

text

Yes

(no default)

conflict behavior

The behavior to use on conflict scenarios. It should be one of the following values: ('fail', 'replace', 'rename')

text

No

(no default)

Examples

Rename an item to a new name

Rename an item to a new name, with 'rename' as the conflict behavior

to upload a (file) to a folder

Upload a file to a folder

Input Concepts

Concept
Description
Type
Required
Default Value

file

The file to upload

file

Yes

(no default)

The folder to upload the file to

google drive folder reference

Yes

(no default)

file name

The name of the file to upload

text

Yes

(no default)

conflict behavior

The behavior to use on conflict scenarios. It should be one of the following values: ('fail', 'replace', 'rename')

text

No

(no default)

Output Concepts

Concept
Description
Type

a file reference to the uploaded file

google drive file reference

Examples

Upload a file to a folder

Upload a file to a folder with a conflict behavior

Last updated

Was this helpful?