Files

Create, update, delete, and query the files and folders contained in a user's Google Drive.

Select

The Files table supports only a subset of columns for filtering. Below is a table containing those columns with their supported operations. All filters can be connected with 'OR' or 'AND' operators.

Column Supported Operators
Name contains, =, !=
MIMEType contains, =, !=
ModifiedTime <=, <, =, !=, >, >=
Trashed =, !=
Starred =, !=
ParentIds in
OwnerEmail in

The contains operator only performs prefix matching for a name. For example, the name "HelloWorld" would match for name contains 'Hello' but not name contains 'World'.

SELECT * FROM [Files] WHERE ModifiedTime>'2017-01-01' OR Contains(Name,'CData')

SELECT * FROM [Files] WHERE OwnerEmail in ('support@cdata.com') AND Starred = true

SELECT * FROM [Files] WHERE Starred = true

SELECT * FROM [Files] WHERE TeamDriveId='0ACkq0ZiV0yJCUk9PVA'
Note: You must set the connection property TeamDriveSupport to 'true', in order to query from a specific Team Drive.

Insert

You must specify values at least for Name and one of LocalFile or FileData.

Insert into Files (Name,LocalFile) VALUES('MyFile','C:\\\\file.txt')

Update

Id is required for updating a File.

Update Files SET Name='UpdatedName' WHERE Id = '19YFv8wmvKixCYaJJAeE8jN3ROt7x1ZicvXwflswVOrw'

Also the content of the file can be updated. Note that this will replace the actual content.

Update Files SET LocalFile='C:\\\\file.txt' WHERE Id = '19YFv8wmvKixCYaJJAeE8jN3ROt7x1ZicvXwflswVOrw'

Delete

To delete a File, the Id is required.

DELETE FROM [Files] WHERE Id = '1Dx6GTyhgTmTjtoy8GuG0n0qaOsKyhwrOG6MG8A2QQYA'

Columns

Name Type ReadOnlyDescription
Id [KEY] StringTrue

The ID of the file.

Name StringFalse

The name of the file. This is not necessarily unique within a folder. Note that for immutable items such as the top level folders of Team Drives, My Drive root folder, and Application Data folder the name is constant.

TeamDriveId StringTrue

The Id of the teamDrive.

Description StringFalse

A short description of the file or folder.

Extension StringTrue

The extension of the file.

MIMEType StringFalse

The MIME type of the file.

CreatedTime DatetimeTrue

The creation date of the file or folder.

ModifiedTime DatetimeTrue

The last modified date of the file or folder.

Size LongTrue

The size of the file in bytes.

OwnerName StringTrue

The name of the resource's owner.

OwnerEmail StringTrue

The email of the resource's owner.

Folder BooleanTrue

This field shows whether or not the resource is a folder.

Starred BooleanFalse

This field sets whether or not the resource is starred.

Trashed BooleanTrue

This field sets whether or not the resource has been moved to the trash.

Viewed BooleanTrue

This field sets whether or not the resource has been viewed by the current user.

ParentIds StringTrue

A comma-separated list of parent folder Ids.

ChildIds StringTrue

A semicolon-separated list of child resource Ids.

ChildLinks StringTrue

A semicolon-separated list of child resource links.

Pseudo-Columns

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.

Name Type Description
Query String

This field accepts a valid Google Drive SDK query, which overrides conditionals in the WHERE clause.

LocalFile String

The local file path, including file name, of the file to be uploaded. Required when FileData is not specified. Used only for inserting and updating a file.

FileData String

If the LocalFile input is empty, file data will be output in the format specified by the Encoding input. Used only for inserting and updating a file.

Encoding String

The FileData input encoding type. Used only for inserting and updating a file.

The allowed values are NONE, BASE64.

The default value is BASE64.