Drives
Manages shared drives for a user by allowing creation, deletion, and querying of drive properties and membership.
Select
The Drives 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 |
| Hidden | =, != |
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 add-in 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 add-in.
SELECT * FROM [Drives] WHERE Hidden = True OR CONTAINS(Name, 'CData')
Insert
To insert into Drives, you must specify the Name field.
INSERT INTO Drives (Name) VALUES ('New Drive')
Update
Id is required for updating a Drive.
UPDATE Drives SET Name = 'Updated Drive Name', CopyRequiresWriterPermission = True, SharingFoldersRequiresOrganizerPermission = True WHERE Id = '19YFv8wmvKixCYaJJAeE8jN3ROt7x1ZicvXwflswVOrw'
Delete
To delete a Drive, the Id is required.
DELETE FROM [Drives] WHERE Id = '1Dx6GTyhgTmTjtoy8GuG0n0qaOsKyhwrOG6MG8A2QQYA'
Columns
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | True |
The unique identifier assigned to the shared or personal drive within Google Drive. |
| Name | String | False |
The display name of the drive as defined by the user or organization. |
| Kind | String | True |
Identifies what kind of resource this is. Value: the fixed string drive#drive. |
| CreatedTime | Datetime | True |
The timestamp indicating when the drive was originally created. |
| OrgUnitId | String | True |
The organizational unit of this shared drive. This field is populated only when DomainAdminAccess is true and the results are not filtered by Id. |
| Hidden | Boolean | True |
Indicates whether the shared drive is hidden from default view (i.e., whether it is shown by default in the Google Drive UI). |
| CanAddChildren | Boolean | True |
Whether the current user can add children to folders in this shared drive. |
| CanComment | Boolean | True |
Whether the current user can comment on files in this shared drive. |
| CanCopy | Boolean | True |
Whether the current user can copy files in this shared drive. |
| CanDeleteDrive | Boolean | True |
Whether the current user can delete this shared drive. |
| CanDownload | Boolean | True |
Whether the current user can download files in this shared drive. |
| CanEdit | Boolean | True |
Whether the current user can edit files in this shared drive. |
| CanListChildren | Boolean | True |
Whether the current user can list the children of folders in this shared drive. |
| CanManageMembers | Boolean | True |
Whether the current user can add members to this shared drive or remove them or change their role. |
| CanReadRevisions | Boolean | True |
Whether the current user can read the revisions resource of files in this shared drive. |
| CanRename | Boolean | True |
Whether the current user can rename files or folders in this shared drive. |
| CanRenameDrive | Boolean | True |
Whether the current user can rename this shared drive. |
| CanChangeDriveBackground | Boolean | True |
Whether the current user can change the background of this shared drive. |
| CanShare | Boolean | True |
Whether the current user can share files or folders in this shared drive. |
| CanChangeCopyRequiresWriterPermissionRestriction | Boolean | True |
Whether the current user can change the copyRequiresWriterPermission restriction of this shared drive. |
| CanChangeDomainUsersOnlyRestriction | Boolean | True |
Whether the current user can change the domainUsersOnly restriction of this shared drive. |
| CanChangeDriveMembersOnlyRestriction | Boolean | True |
Whether the current user can change the driveMembersOnly restriction of this shared drive. |
| CanChangeSharingFoldersRequiresOrganizerPermissionRestriction | Boolean | True |
Whether the current user can change the sharingFoldersRequiresOrganizerPermission restriction of this shared drive. |
| CanResetDriveRestrictions | Boolean | True |
Whether the current user can reset the shared drive restrictions to defaults. |
| CanDeleteChildren | Boolean | True |
Whether the current user can delete children from folders in this shared drive. |
| CanTrashChildren | Boolean | True |
Whether the current user can trash children from folders in this shared drive. |
| CanChangeDownloadRestriction | Boolean | True |
Whether the current user can change organizer-applied download restrictions of this shared drive. |
| CopyRequiresWriterPermission | Boolean | False |
Whether the options to copy, print, or download files inside this shared drive, should be disabled for readers and commenters. |
| IsDomainUsersOnly | Boolean | False |
Whether access to this shared drive and items inside this shared drive is restricted to users of the domain to which this shared drive belongs. |
| IsDriveMembersOnly | Boolean | False |
Whether access to items inside this shared drive is restricted to its members. |
| IsAdminManagedRestrictions | Boolean | False |
Whether administrative privileges on this shared drive are required to modify restrictions. |
| SharingFoldersRequiresOrganizerPermission | Boolean | False |
If true, only users with the organizer role can share folders. If false, users with either the organizer role or the file organizer role can share folders. |
| ColorRGB | String | False |
The color of this shared drive as an RGB hex string. |
| BackgroundImageLink | String | True |
A short-lived link to this shared drive's background image. |
| ItemURL | String | True |
Direct URL to open the shared drive in the Google Drive web interface. |
| 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. |
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 |
| ThemeId | String |
Sets the theme for the drive by ID. Write-only; ignored if ColorRgb or BackgroundImageFile is set. If omitted, a random theme is used. |
| BackgroundImageFileId | String |
The ID of an image file in Google Drive to use for the background image. It can only be set on update statements that don't set ThemeId. |
| BackgroundImageFileXCoordinate | Float |
The X coordinate of the upper left corner of the cropping area in the background image. It can only be set on update statements that don't set ThemeId. |
| BackgroundImageFileYCoordinate | Float |
The Y coordinate of the upper left corner of the cropping area in the background image. It can only be set on update statements that don't set ThemeId. |
| BackgroundImageFileWidth | Float |
The width of the cropped image in the closed range of 0 to 1. It can only be set on update statements that don't set ThemeId. |
| DomainAdminAccess | Boolean |
If the value is 'true', all drives associated with your domain are returned, provided you are a domain administrator. |