Google DriveSend and retrieve data from Google Drive
Get access to files anywhere through secure cloud storage and file backup for your photos, videos, files and more.
Within the workflow builder, highlight the Google Drive connector.
In the Google Drive connector properties panel (to the right of the builder), click on the Authenticate tab and the 'Add new authentication' button.
This will result in a Tray.io authentication pop-up modal. The first page will ask you to name your authentication and select the type of authentication you wish to create ('Personal' or 'Organisational').
The next page asks you to set the scopes you wish your authentication to have access to. Select these depending on your project needs.
Once you have set these fields to your Tray.io authentication popup window, click the 'Create authentication' button.
Go back to your settings authentication field (within the workflow builder properties panel), and select the recently added authentication from the dropdown options now available.
Your connector authentication setup should now be complete.
Note on Operations usage
Google Drive is NECESSARY to List Available Spreadsheets
Previously we included the ability to get a list of users spreadsheets from within the Google Sheets connector itself. Regardless of this, behind the scenes it has always been a separate task, actually stemming from the Google Drive connector itself.
Due to new security updates from Google, this feature now needs to be spilt in its entirety. This update effectively breaks all and any previous workflows that were dependent upon this ability within the Google Sheets connector.
There are 2 ways to navigate this issue:
- You can connect a new Google Drive connector to an earlier point withing your current workflow, and set it up in such as way so as to list all the current available spreadsheets found in conjunction with your Google Sheets user.
- If you have individual sheets in mind, and you know the Google Sheet ID, you can utilise that ID by putting it directly into the relevant Google Sheet operation field, where needed. In order to find the sheet ID, you need only look at the Google Sheet URL, and copy the hash found between the
As the Google Drive connector holds most of the permissions available for downloading Google files (regardless of type) - it is recommended to try revising your workflow to include this connector, should you face any Google file downloading issues.
Download file types
Note that your Google Drive download will fail if the file type you are downloading is not accurately set.
- Download Google file: Best used when you wish to export a Google document for use in other services or programme (such as MS word etc).
- Download file: Best used when downloading a file from your Drive that is in a unrecognised file format, one that Google Drive does not support. Despite not having a recognised format, this operation will be able to download a file based off its Google file ID. This is found in the URL of the file in question.
Below is an example of a way in which you could potentially use the Google Drive connector, to get the File ID from a drive file and download said file for later use.
The steps will be as follows:
- Setup using a manual trigger and add a Google Drive connector to the workflow.
- Once all files are listed, download said file.
- Use the CSV Editor to download the specified file.
Your completed workflow should look similar to this:
1 - Setup Trigger & List files
Your 'Source' property will depend on your Drive structure and where the file you wish to download is based. In this case we have selected 'user' from the dropdown options available.
Note that the 'Drive ID' is only required if the aforementioned 'Source' is set to 'Drive'.
In order to speed up the query, select and set both of the filter options available, aka: 'Filter by Folder' and 'Filter by Name'.
Feel free to re-name your steps as you go along to make things clearer for yourself and other users. The operation names themselves often suffice.
Now when the workflow is triggered, it will run a search query to find all the available files found within the specified source folder. In this case we already knew the name of the file that we wished to download as well, which speeds the investigation up further.
2 - Download file
Add another Google Drive connector into your workflow as your next step. Set your operation to 'Download Google file'.
In order to specify the list you want to collect your 'File ID' from, start by using the list mapping icon (found next to the list input field, within the properties panel) to generate the connector-snake.
While hovering over the 'Get File ID from Drive' step (with the tail end of the connector-snake), select your file from the list of output properties displayed. This will auto-populate a jsonpath within your list input field, and update the type selector to jsonpath.
In this case, the name of the file we wished to download was already known and only returned a single result. You may wish to consider using the Loop connector if your results return an array of results instead.
For more clarification on the pathways you have available, open the Debug panel to view your step's Input and Output. When run, you will be able to see a URL is returned in the Output panel. Users can navigate to this URL to download a copy of the file locally should they wish to.
3 - Create temp CSV
Using a CSV Editor step, set the operation to 'Create CSV From File'. The file is only needed for short term storage so we set the 'Scope' to 'Current run'.
The 'File URL' is gleaned using the same connector-snake method from earlier.
When run the workflow will now create a simple CSV file from the original Google file. One that remains in scope and can be manipulated and edited within and across workflows.
Checkout the Output panel once more to see the column headers of the temporary CSV file in question. They should correlate to the the original Google file.