Files
Handles operations on files and folders in Google Drive, such as retrieving file details, modifying metadata, and organizing file structure.
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, =, in |
| MIMEType | contains, =, != |
| CreatedTime | <=, <, =, !=, >, >= |
| ModifiedTime | <=, <, =, !=, >, >= |
| ShortcutTargetId | = |
| Trashed | =, != |
| Starred | =, != |
| ParentIds | = |
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'.
The 本製品 uses the Google Drive API to process WHERE clause conditions built with the following column. The rest of the filter is executed client-side within the 本製品.
SELECT * FROM [Files] WHERE ModifiedTime > '2017-01-01' OR CONTAINS(Name, 'CData')
SELECT * FROM [Files] WHERE OwnerEmail IN ('[email protected]') AND Starred = true
SELECT * FROM [Files] WHERE Starred = true
SELECT * FROM [Files] WHERE DriveId = '0ACkq0ZiV0yJCUk9PVA'
Note: You must set the connection property SupportsAllDrives to true, in order to query from a specific Drive.
Insert
File uploads are supported via UploadFile Stored Procedure
Update
Id is required for updating a File.
UPDATE Files SET Name = 'UpdatedName' WHERE Id = '19YFv8wmvKixCYaJJAeE8jN3ROt7x1ZicvXwflswVOrw'
Delete
To delete a File, the Id is required.
DELETE FROM [Files] WHERE Id = '1Dx6GTyhgTmTjtoy8GuG0n0qaOsKyhwrOG6MG8A2QQYA'
Columns
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | True |
The unique identifier assigned to the file in Google Drive. |
| Name | String | False |
The display name of the file. This name does not need to be unique within a folder. Items such as the root folder of My Drive, Team Drive roots, and the Application Data folder have fixed names. |
| DriveId | String | True |
The identifier of the personal or shared drive that contains the file. |
| ParentIds | String | True |
The unique identifier of the parent folder that contains the file. If omitted, the file is located in the root directory.To update the value of ParentIds, use the MoveResource stored procedure. |
| MIMEType | String | True |
The Multipurpose Internet Mail Extensions (MIME) type of the file, such as application/pdf or image/jpeg, indicating the file's format. |
| Size | Long | True |
The total size of the file in bytes. This does not apply to folders or native Google Workspace files. |
| Extension | String | True |
The file extension that reflects its format, such as pdf, csv, or jpg. |
| FileExtension | String | True |
The file extension as returned by the Google Drive API for files with binary content. This may differ from the full file extension. |
| OriginalFilename | String | True |
The original filename of the uploaded file, if available. |
| Description | String | False |
A user-defined summary describing the purpose or contents of the file or folder. |
| Folder | Boolean | True |
If the value is 'true', the resource is a folder. If 'false', it is a file. |
| CreatedTime | Datetime | True |
The timestamp when the file or folder was first created in Google Drive. |
| ModifiedTime | Datetime | True |
The timestamp of the most recent change made to the file or folder. |
| ModifiedByMeTime | Datetime | True |
The last time the user modified the file. |
| SharedWithMeTime | Datetime | True |
The time when the file was shared with the user. |
| TrashedTime | Datetime | True |
The time that the file was trashed. |
| OwnerName | String | True |
The full name of the user who owns the file or folder. |
| OwnerEmail | String | True |
The email address of the owner of the file or folder. |
| LastModifiedByName | String | True |
The display name of the last user to modify the file. This field is only populated when the last modification was performed by a signed-in user. |
| LastModifiedByEmail | String | True |
The email address of the last user to modify the file. This field is only populated when the last modification was performed by a signed-in user. |
| IsOwnedByMe | Boolean | True |
Indicates whether the current user owns the file. |
| IsModifiedByMe | Boolean | True |
Indicates whether the file has been modified by the current user. |
| IsShared | Boolean | True |
Indicates whether the file has been shared with other users. |
| SharingUserName | String | True |
The display name of the user who shared the file with the current user. |
| SharingUserEmail | String | True |
The email address of the user who shared the file with the current user. |
| Permissions | String | True |
The full list of permissions for the file represented as a JSON aggregate. This is only available if the requesting user can share the file. Not populated for items in shared drives. |
| PermissionIds | String | True |
The list of permission IDs for users with access to this file. |
| WritersCanShare | Boolean | False |
Indicates whether users with write access can share the file. |
| ViewersCanCopyContent | Boolean | False |
Indicates whether viewers and commenters can copy, download, or print the file. |
| CopyRequiresWriterPermission | Boolean | False |
Indicates whether copying the file requires writer permission. |
| HasAugmentedPermissions | Boolean | True |
Indicates whether the user has additional permissions on the file. |
| InheritedPermissionsDisabled | Boolean | True |
Indicates whether the file inherits permissions from its parent. |
| Starred | Boolean | False |
If the value is 'true', the resource is marked as starred by the user. |
| Trashed | Boolean | False |
If the value is 'true', the resource has been moved to the trash. |
| Viewed | Boolean | True |
If the value is 'true', the file or folder has been opened or previewed by the authenticated user. |
| TrashingUserName | String | True |
The display name of the user who moved the file to trash. |
| TrashingUserEmail | String | True |
The email address of the user who moved the file to trash. |
| CanChangeViewersCanCopyContent | Boolean | True |
Whether the user can change whether viewers can copy content, download, or print the file. |
| CanMoveChildrenOutOfDrive | Boolean | True |
Whether the user can move children out of this drive. |
| CanReadDrive | Boolean | True |
Whether the user can read the drive to which this file belongs. |
| CanEdit | Boolean | True |
Whether the user can edit this file. |
| CanCopy | Boolean | True |
Whether the user can copy this file. |
| CanComment | Boolean | True |
Whether the user can comment on this file. |
| CanAddChildren | Boolean | True |
Whether the user can add children to this folder. |
| CanDelete | Boolean | True |
Whether the user can delete this file. |
| CanDownload | Boolean | True |
Whether the user can download this file. |
| CanListChildren | Boolean | True |
Whether the user can list the children of this folder. |
| CanRemoveChildren | Boolean | True |
Whether the user can remove children from this folder. |
| CanRename | Boolean | True |
Whether the user can rename this file. |
| CanTrash | Boolean | True |
Whether the user can move this file to trash. |
| CanReadRevisions | Boolean | True |
Whether the user can read the revisions resource of this file. |
| CanReadTeamDrive | Boolean | True |
Whether the user can read the Team Drive to which this file belongs. |
| CanMoveTeamDriveItem | Boolean | True |
Whether the user can move this Team Drive item. |
| CanChangeCopyRequiresWriterPermission | Boolean | True |
Whether the user can change the copyRequiresWriterPermission restriction of this file. |
| CanMoveItemIntoTeamDrive | Boolean | True |
Whether the user can move this item into a Team Drive. |
| CanUntrash | Boolean | True |
Whether the user can restore this file from trash. |
| CanModifyContent | Boolean | True |
Whether the user can modify the content of this file. |
| CanMoveItemWithinTeamDrive | Boolean | True |
Whether the user can move this item within a Team Drive. |
| CanMoveItemOutOfTeamDrive | Boolean | True |
Whether the user can move this item out of a Team Drive. |
| CanDeleteChildren | Boolean | True |
Whether the user can delete children of this folder. |
| CanMoveChildrenOutOfTeamDrive | Boolean | True |
Whether the user can move children out of this Team Drive folder. |
| CanMoveChildrenWithinTeamDrive | Boolean | True |
Whether the user can move children within this Team Drive folder. |
| CanTrashChildren | Boolean | True |
Whether the user can move children of this folder to trash. |
| CanMoveItemOutOfDrive | Boolean | True |
Whether the user can move this item out of this drive. |
| CanAddMyDriveParent | Boolean | True |
Whether the user can add a parent for this item in My Drive. |
| CanRemoveMyDriveParent | Boolean | True |
Whether the user can remove a parent from this item in My Drive. |
| CanMoveItemWithinDrive | Boolean | True |
Whether the user can move this item within this drive. |
| CanShare | Boolean | True |
Whether the user can share this file. |
| CanMoveChildrenWithinDrive | Boolean | True |
Whether the user can move children within this drive. |
| CanModifyContentRestriction | Boolean | True |
Whether the user can modify content restrictions on this file. |
| CanAddFolderFromAnotherDrive | Boolean | True |
Whether the user can add a folder from another drive to this folder. |
| CanChangeSecurityUpdateEnabled | Boolean | True |
Whether the user can change the security update enabled setting for this file. |
| CanAcceptOwnership | Boolean | True |
Whether the user can accept ownership of this file. |
| CanReadLabels | Boolean | True |
Whether the user can read the labels on this file. |
| CanModifyLabels | Boolean | True |
Whether the user can modify the labels on this file. |
| CanModifyEditorContentRestriction | Boolean | True |
Whether the user can modify editor content restrictions on this file. |
| CanModifyOwnerContentRestriction | Boolean | True |
Whether the user can modify owner content restrictions on this file. |
| CanRemoveContentRestriction | Boolean | True |
Whether the user can remove content restrictions on this file. |
| CanDisableInheritedPermissions | Boolean | True |
Whether the user can disable inherited permissions on this file. |
| CanEnableInheritedPermissions | Boolean | True |
Whether the user can enable inherited permissions on this file. |
| CanChangeItemDownloadRestriction | Boolean | True |
Whether the user can change the download restriction on this file. |
| ReadOnly | Boolean | False |
Indicates if the file is read-only due to a restriction or policy. |
| RestrictionReason | String | False |
The reason why the file is restricted, if applicable. |
| RestrictionType | String | True |
The type of restriction applied to the file, such as content or sharing restriction. |
| RestrictingUserName | String | True |
The display name of the user who applied the restriction to the file. |
| RestrictingUserEmail | String | True |
The email address of the user who applied the restriction to the file. |
| RestrictionTime | Datetime | True |
The timestamp when the restriction was applied to the file. |
| OwnerRestricted | Boolean | False |
Indicates if the file is restricted by the owner. |
| SystemRestricted | Boolean | True |
Indicates if the file is restricted by the system. |
| IsSecurityUpdateEligible | Boolean | True |
Indicates whether the file is eligible for a security update related to link sharing. |
| IsSecurityUpdateEnabled | Boolean | True |
Indicates whether the security update for link sharing is enabled on the file. |
| WebViewLink | String | True |
A link for opening the file in a relevant Google editor or viewer in a browser. |
| WebContentLink | String | True |
A link for downloading the file's content in a browser. |
| ResourceKey | String | True |
A key required to access the file via a shared link. |
| ThumbnailLink | String | True |
A URL to a thumbnail image of the file. |
| IconLink | String | True |
A URL to the icon representing the file type. |
| FolderColorRGB | String | False |
The color of the folder as an RGB hex string, if set. |
| HasThumbnail | Boolean | True |
Indicates whether the file has a thumbnail image. |
| ThumbnailVersion | Integer | True |
The version of the file's thumbnail. |
| ImageMediaMetadata | Object | True |
Metadata about image media, such as camera settings. |
| VideoMediaMetadata | Object | True |
Metadata about video media, such as duration and dimensions. |
| MD5Checksum | String | True |
The MD5 checksum for the file content. |
| SHA1Checksum | String | True |
The SHA-1 checksum for the file content. |
| SHA256Checksum | String | True |
The SHA-256 checksum for the file content. |
| Version | Integer | True |
The version number of the file. |
| HeadRevisionId | String | True |
The ID of the file's head revision. |
| ShortcutTargetId | String | True |
The ID of the file or folder that the shortcut points to. |
| ShortcutTargetMIMEType | String | True |
The MIME type of the target file or folder that the shortcut points to. |
| Properties | Object | False |
A collection of arbitrary key-value pairs which are visible to all apps. |
| AppProperties | Object | False |
A collection of arbitrary key-value pairs which are private to the requesting app. |
| ExportLinks | Object | True |
A map of export formats to URLs for downloading Google Workspace documents in different formats. |
| Kind | String | True |
Identifies what kind of resource this is. Value: the fixed string drive#file. |
| Spaces | String | True |
The list of spaces the file is in, such as drive, appDataFolder, or photos. |
| QuotaBytesUsed | Integer | True |
The number of storage quota bytes used by the file. |
| IsAppAuthorized | Boolean | True |
Indicates whether the file was created or opened by the requesting app. |
| Query | String | True |
Accepts a custom query string using the Google Drive Software Development Kit (SDK) language. Overrides any conditions defined in the WHERE clause. |