The Google Drive modules enable you to monitor, search, create, update, delete, and manage your files, folder, or shared drives in your Google Drive.
Prerequisites
In order to use Google Drive with Integromat, it is necessary to have a Google account. If you do not have one, you can create a Google account at accounts.google.com/signup.
To connect your Google Drive account to Integromat as a G Suite user (Business Gmail account) follow the general instructions for Connecting to services.
After you click the Continue button, Integromat will redirect you to the Google website where you will be prompted to grant Integromat access to your account:
Here, allow access by clicking the Allow button. Afterwards, you will be redirected back to the Integromat scenario. Now, you can continue creating your scenario.
If you are @gmail.com or @googlemail.com user you need to create an OAuth client on the Google Cloud Platform in order to obtain Client ID and Client Secret.
For step-by-step instructions on how to create the OAuth client (and obtain Client ID and Client Secret) please refer to the Connecting Integromat To Google Services Using a Custom OAuth Client documentation or see the video tutorial below.
To find out whether you are G Suite user or @gmail user please see the Google API restrictions (Do I have a G Suite account? section) article.
Retrieves file details when a file is added or modified in the specified folder.
Connection | Establish a connection to your Google Drive. |
Watch Files | Select whether you want to watch new files in the folder (By Created Time), or modified files (By Modified Time). |
Choose a Drive |
Select whether you want to watch files in one of the following locations:
|
Select the Folder to be Watched | Navigate to the folder you want to watch. |
File Types to Watch |
Select file type to filter watched files by. |
Limit |
Set the maximum number of files Integromat will return during one execution cycle. |
Retrieves file details when a file in your Google Drive is added or modified.
Connection | Establish a connection to your Google Drive. |
Watch Files | Select whether you want to watch new files in the folder (By Created Time), or modified files (By Modified Time). |
Choose a Drive |
Select whether you want to watch files in one of the following locations:
|
File Types to Watch |
Select file type to filter watched files by. |
Limit |
Set the maximum number of files Integromat will return during one execution cycle. |
Retrieves folder details when a new folder is created or the existing one is modified.
Connection | Establish a connection to your Google Drive. |
Watch Files | Select whether you want to watch new folders (By Created Time), or modified folders (By Modified Time). |
Choose a Drive |
Select whether you want to watch folders in one of the following locations:
|
Choose a Folder | Navigate to the folder you want to watch for the folders. |
Limit |
Set the maximum number of folders Integromat will return during one execution cycle. |
Searches for files or folders based on search criteria.
Connection | Establish a connection to your Google Drive. | ||||||
Choose a Drive |
Select the location where you want to search for files or folders:
|
||||||
Choose a Folder | Navigate to the folder you want to search for the files or folders. | ||||||
Retrieve | Select whether you want to search for files, folders, or both. | ||||||
Search |
Select the type of the search you want to perform.
|
||||||
Query |
Enter the query (differs based on the search type selected in the Search field above).
|
||||||
Limit |
Set the maximum number of files or folders Integromat will return during one execution cycle. |
Downloads a file from your Google Drive.
Connection | Establish a connection to your Google Drive. |
Choose a Drive |
Select the location where you want to download a file from:
|
Enter a File ID | Select whether you want to enter (map) the file ID manually or select the file using the menu. |
File ID | Enter (map) the file ID of the file you want to download. |
Convert Google Documents/Spreadsheets/Slides/Drawings Files to Format | Select the file type of the file you want to download and target file type you want convert to the file to.
|
Creates a file in the selected Google Drive folder.
Connection | Establish a connection to your Google Drive. |
Choose a Drive |
Select the location where you want to create the file at:
|
New Text File Location | Select the target location where you want to create the new file. |
File Name | Enter the name for the new file. |
File Content | Enter the plain text content of the new file. |
Convert the File to Google Docs Document | Enable this to set the file's mimeType to application/vnd.google-apps.document instead of text/plain. |
Creates a folder in the specified location.
Connection | Establish a connection to your Google Drive. |
Choose a drive |
Select the drive where you want to create the folder:
|
New Folder Location | Select the target location where you want to create the new folder. |
New Folder's Name | Enter the name for the new folder. |
Share Folder | If enabled, the folder is shared to anyone with the link of the folder (Web View Link). Otherwise the Web View Link works for the owners only. |
Type | Select permission for the folder. A permission grants a user, group, domain, or the world access to a folder hierarchy. |
Role | Select the role to define what users can do with a file or folder. For the list of operations users can perform for each role please refer to the Roles documentation. |
Uploads a file to your Google Drive.
Connection | Establish a connection to your Google Drive. |
Enter a Folder ID |
Select whether you want to enter (map) the folder ID manually or select the folder using the menu. |
Folder ID | Enter (map) the folder ID of the folder you want to upload the file to. |
New File Name | Enter the new file name if you want to change the name of the file. |
Source File | Map the file you want to upload from the previous module (e.g. HTTP > Get a File or Dropbox > Get a file), or enter the file name and file data manually. |
Updates a file's metadata or content.
Connection | Establish a connection to your Google Drive. |
Enter a File ID |
Select whether you want to enter (map) the file ID manually or select the file using the menu. |
File ID | Enter (map) the File ID of the file you want to update. |
New Updated File Name | Enter the new file name if you want to change the name of the file. |
File Description | Enter the new file description. |
Change File Content | Enable this option to change the file content. The new file must have the same mimeType as the original file. |
Source File | Map the file you want to upload from the previous module (e.g. HTTP > Get a File or Dropbox > Get a file), or enter the file name and file data manually. |
Moves a file or folder to the trash.
Connection | Establish a connection to your Google Drive. |
Enter a File/Folder ID |
Select whether you want to enter (map) the file or folder ID manually or select the file or folder using the menu. |
Select File/Folder |
Select whether you want to move the file or folder to the trash. |
File ID / Folder ID | Enter (map) the File ID (or folder ID) of the file (or folder) you want to move to the trash. |
Permanently deletes a file or folder.
Connection | Establish a connection to your Google Drive. |
Enter a File/Folder ID |
Select whether you want to enter (map) the file or folder ID manually or select the file or folder using the menu. |
Select File/Folder |
Select whether you want to permanently delete a file or folder. |
File ID / Folder ID | Enter (map) the File ID (or folder ID) of the file (or folder) you want to permanently delete. |
Copies a file to the new location.
Connection | Establish a connection to your Google Drive. |
Original File's Drive |
Select the drive you want to copy the file from:
|
Original File ID |
Enter (map) the File ID of the original file you want to copy. |
New Drive Location |
Select the target drive you want to copy the file to:
|
New Folder Location |
Select the target folder you want to copy the file to. |
Copied File Name | Enter the new file name if you want to change the name of the file in the target location. |
Moves a file or folder to the new target location.
Connection | Establish a connection to your Google Drive. |
Choose a Drive |
Select the drive you want to move the file or folder from:
|
Select File/Folder |
Select whether you want to move a file or folder. |
File ID/ Folder ID |
Enter (map) the File ID (or Folder ID) of the file (or folder) you want to move. |
New Drive Location |
Select the target drive you want to move the file or folder to:
|
New Folder Location |
Select the target folder you want to move the file or folder to. |
Retrieves and sets up permissions and sends share link for a file or folder.
Connection | Establish a connection to your Google Drive. |
Choose a Drive |
Select the drive that contains the file or folder you want to share:
|
Select File/Folder |
Select whether you want to share a file or folder. |
File ID/ Folder ID |
Enter (map) the File ID (or Folder ID) of the file (or folder) you want to share. |
Role |
Select the role granted by this permission to define what users can do with a file or folder. For the list of operations users can perform for each role please refer to the Roles documentation. |
Type |
Select a permission for the file or folder. A permission grants a user, group, domain or the world access to a folder hierarchy or to the file. |
Email address / Organization Domain | Enter the email address or organization domain you want to restrict the access to the file or folder to. |
Send notification email | The notification email with the link will be sent to the specified email address. |
Allow File Discovery | Enable to define whether the permission allows the file to be discovered through search. |
Triggers when a shared drive is created.
Connection | Establish a connection to your Google Drive. |
Search | Select whether you want to filter returned drives by custom search query or query filter. |
Query filter | Set the filter to filter returned shared drives by name, organizer count, or member count. You can also use AND and OR operators to combine the filter. |
Query | Enter your custom search query. For example: name contains 'integromat' and memberCount >= 20 For more info, see the documentation. |
Limit | Set the maximum number of drives Integromat will return during one execution cycle. |
Searches for the Google shared drive.
Connection | Establish a connection to your Google Drive. |
Search | Select whether you want to filter returned drives by custom search query or query filter. |
Query filter | Set the filter to filter returned shared drives by name, organizer count, member count, or created time. You can also use AND and OR operators to combine the filter. |
Query | Enter your custom search query. For example: name contains 'integromat' and memberCount >= 20 For more info, see the documentation. |
Limit | Set the maximum number of drives Integromat will return during one execution cycle. |
Creates a new shared drive.
Connection | Establish a connection to your Google Drive. |
New Shared Drive's Name | Enter the name for the new shared drive. |
Retrieves shared drive details.
Connection | Establish a connection to your Google Drive. |
Shared Drive ID | Enter (map) the ID or select the drive you want to retrieve details about. |
Updates an existing drive's name and/or restrictions.
Connection | Establish a connection to your Google Drive. | ||||||||
Shared Drive ID | Enter (map) the ID or select the drive you want to update. | ||||||||
Name | Enter the new name for the shared drive. | ||||||||
Restrictions |
Enable or disable restrictions that apply to this shared drive or items inside this shared drive.
|
Permanently deletes a shared drive for which the user is an organizer. The shared drive cannot contain any untrashed items.
Connection | Establish a connection to your Google Drive. |
Shared Drive ID | Enter (map) the ID or select the drive you want to delete. |
Triggers when a comment is added or modified on the selected file.
Connection | Establish a connection to your Google Drive. |
Watch Comments | Select whether you want to watch new comments (By Created Time), or modified comments (By Modified Time). |
Choose a Drive |
Select whether you want to watch comments in one of the following locations:
|
File ID | Navigate to and select the file you want to watch for comments. |
Limit |
Set the maximum number of comments Integromat will return during one execution cycle. |
Allows you to perform a custom API call.
Connection | Establish a connection to your Google Drive.. |
URL |
Enter a path relative to For the list of available endpoints, refer to the Google Drive API Documentation.
|
Method |
Select the HTTP method you want to use: GET POST PUT PATCH DELETE |
Headers | Enter the desired request headers. You don't have to add authorization headers; we already did that for you. |
Query String | Enter the request query string. |
Body | Enter the body content for your API call. |
The following API call returns all files in your Google Drive:
URL:/v3/files
Method:GET
The result can be found in the module's Output under Bundle > Body > files.
In our example, 30 files were returned:
In the module Search for Files/Folders you can use your own query which consists of these parts:
Field - Attribute of the file that is being searched, e.g. the attribute name
of the file.
Operator - Test that is performed on the data to provide a match, e.g. contains
.
Value - The content of the attribute that is tested, e.g. the name of the file My cool document
.
Combine clauses with the conjunctions and
or or
, and negate the query with not
.
Term | Valid operators | Usage |
---|---|---|
name |
contains 1, = , != |
Name of the file. Surround with single quotes ' . Escape single quotes in queries with \' , e.g., 'Valentine\'s Day' . |
fullText |
contains 2 3 |
Full text of the file including name, description, content, and indexable text. Whether the 'title', 'description', or 'indexableText' properties, or the content of the file matches. Surround with single quotes ' . Escape single quotes in queries with \' , e.g., 'Valentine\'s Day' . |
mimeType |
contains , = , != |
MIME type of the file. Surround with single quotes ' . Escape single quotes in queries with \' , e.g., 'Valentine\'s Day' . |
modifiedTime |
<= , < , = , != , > , >= |
Date of the last modification of the file. RFC 3339 format, default timezone is UTC, e.g., 2012-06-04T12:00:00-08:00 . Fields of type date are not currently comparable to each other, only to constant dates. |
viewedByMeTime |
<= , < , = , != , > , >= |
Date that the user last viewed a file. RFC 3339 format, default timezone is UTC, e.g., 2012-06-04T12:00:00-08:00 . Fields of type date are not currently comparable to each other, only to constant dates. |
trashed |
= , != |
Whether the file is in the trash or not. Can be either true or false . |
starred |
= , != |
Whether the file is starred or not. Can be either true or false . |
parents |
in |
Whether the parents collection contains the specified ID. |
owners 4 |
in |
Users who own the file. |
writers 4 |
in |
Users or groups who have permission to modify the file. See Permissions resource reference. |
readers 4 |
in |
Users or groups who have permission to read the file. See Permissions resource reference. |
sharedWithMe |
= , != |
Files that are in the user's "Shared with me" collection. All file users are in the file's access control list (ACL). Can be either true or false . |
properties |
has |
Public custom file properties. |
appProperties |
has |
Private custom file properties. |
visibility |
= , '!=' |
The visibility level of the file. Valid values are anyoneCanFind, anyoneWithLink, domainCanFind, domainWithLink, and limited. Surround with single quotes ' . Escape single quotes in queries with \' , e.g., 'Valentine\'s Day' . |
[1] 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'
.
[2] The contains
operator only performs matching on entire string tokens for fullText
. For example, if the full text of a doc contains the string "HelloWorld" only the query fullText contains 'HelloWorld'
returns a result. Queries such as fullText contains 'Hello'
do not return results in this scenario.
[3] The contains
operator matches on an exact alphanumeric phrase if it is surrounded by double quotes. For example, if the fullText
of a doc contains the string "Hello there world", then the query fullText contains '"Hello there"'
returns a result, but the query fullText contains '"Hello world"'
doesn't. Furthermore, since the search is alphanumeric, if the fullText
of a doc contains the string "Hello_world", then the query fullText contains '"Hello world"'
returns a result.
[4] The owners
, writers
and readers
properties are indirectly reflected in the list and refer to the role on the permission.
Value Type | Notes |
---|---|
String | Surround with single quotes ' . Escape single quotes in queries with \' , e.g., 'Valentine\'s Day' . |
Boolean | true or false . |
Date | RFC 3339 format, default timezone is UTC, e.g., 2012-06-04T12:00:00-08:00 . |
Operator | Usage |
---|---|
contains |
The content of one string is present in the other. |
= |
The content of a string or boolean is equal to the other. |
!= |
The content of a string or boolean is not equal to the other. |
< |
A value is less than another. |
<= |
A value is less than or equal to another. |
> |
A value is greater than another. |
>= |
A value is greater than or equal to another. |
in |
An element is contained within a collection. |
and |
Return items that match both queries. |
or |
Return items that match either query. |
not |
Negates a search query. |
has |
A collection contains an element matching the parameters. |
For compound clauses, you can use parentheses to group clauses together. For example:modifiedTime > '2019-06-04T12:00:00' and (mimeType contains 'image/' or mimeType contains 'video/')
This search returns all files with an image or video MIME type that their last modification was after June 4, 2019. Because and
and or
operators are evaluated from left to right, without parentheses, the above example would return only images modified after June 4, 2019, but would return all videos, even those before June 4, 2019.
Files with the name "hello" | name = 'hello' |
Files with a name containing the words "hello" and "goodbye" | name contains 'hello' and name contains 'goodbye' |
Files with a name that does not contain the word "hello" | not name contains 'hello' |
Folders that are Google apps or have the folder MIME type |
mimeType = 'application/
vnd.
google-apps.
folder'
|
Files that are not folders |
mimeType != 'application/
vnd.
google-apps.
folder'
|
Files that contain the text "important" and in the trash | fullText contains 'important' and trashed = true |
Files that contain the word "hello" | fullText contains 'hello' |
Files that do not have the word "hello" | not fullText contains 'hello' |
Files that contain the exact phrase "hello world" | fullText contains '"hello world"' |
Files with a query that contains the "" character (e.g., "\authors") | fullText contains '\\authors' |
Files with ID within a collection, e.g. parents collection |
'1234567' in parents |
Files in an Application data folder in a collection | 'appDataFolder' in parents |
Files for which user "test@example.org" has write permission |
'test@example.
org' in writers
|
Files for which members of the group "group@example.org" have write permission |
'group@example.
org' in writers
|
Files modified after a given date |
modifiedTime > '2012-06-04T12:00:00' /
/
default time zone is UTC
|
Files shared with the authorized user with "hello" in the name | sharedWithMe and name contains 'hello' |
Files that have not been shared with anyone or domains (only private, or shared with specific users or groups) | visibility = 'limited' |
Image or video files modified after a specific date |
modifiedTime > '2012-06-04T12:00:00' and (mimeType contains
'image/
' or mimeType contains 'video/
')
|
(Reference: Google Drive API v3 - Search for files and folders, Google Drive API v3 - Search query terms)
There are several situations when uploading or updating a file fails:
The uploaded file is too big and exceeds the maximum file size limit allowed for your Google Drive plan or you have exceeded your Google Drive storage limit. You can either upgrade your storage plan or delete existing files from the Google Drive service.
The selected folder where the file was to be uploaded to no longer exists. The scenario stops and it is then necessary to select a target folder again.
last update: 2020-06-08