- 16 Apr 2024
- 2 Minutes to read
- DarkLight
Upload Content To Google Drive
- Updated on 16 Apr 2024
- 2 Minutes to read
- DarkLight
General
This type of action can be used to upload content (such as external files or report documents) to a shared Google Drive.
Properties
This type of action has the following properties:
Name | Description |
---|---|
Content Type | The type of content you want to upload (see below). |
Client E-Mail | The Client E-Mail for the service account you create for this action to use (see below). |
Private Key | The Private Key for the service account you create for this action to use (see below). |
Drive Name | An Expression that evaluates to a string that contains the name of the shared drive containing the remote path to upload the file to. |
Description | An Expression that evaluates to a string that contains description to set for the file you upload to Google drives. |
Remote Path | An Expression that evaluates to a string that contains the path to upload the content to. |
Authenticating with Google Drive
You will need to follow these steps in order to connect to Google Drive::
- Create a new project in Google Cloud Console.
- Locate the APIs & Services -> Enabled APIs & services section of the configuration and on the ENABLE APIS AND SERVICES screen, locate and enable the Google Drive API.
- Locate the IAM & Admin -> Service Accounts screen and create a new service account. Once this is created, locate the KEYS tab for the service account and create a new JSON key. This should download a JSON file containing the Client E-Mail (client_email) and Private Key (private_key) properties needed for the connection. We would recommend storing this file in a secure location..
- You will need to give this service account (i.e. the Client E-Mail) read and write access to the drives where you wish to upload content to.
Content Types
Uploading a Report Document
You can upload a report document (that you have previously created, for instance with a Create Report Document) by setting the Content Type to Report Document. An additional property Content will be available where you can select the report document you want to upload. The Remote Path property must return the path on the shared Google Drive including the file name (but excluding the file extension).
Uploading an External File
You can upload an external file to the Google Drive by setting the property Content Type to External File. A new property Content Path will be available which is an Expression that evaluates to a string that contains a local or UNC file path to the external file to upload. The Remote Path property must return the path on the shared Google Drive including the file name.
Uploading a File Collection
You can upload all files of a File Collection by setting the property Content Type to File Collection. A new property Content will be available where you can select the file collection to upload. The Remote Path property must return the path on the shared Google Drive but not include any file name, because the file names of the content of the file collections will be used for the upload.
Uploading a Zipped File Collection
You can upload a ZIP file that contains all files of a File Collection by setting the property Content Type to Zipped File Collection. A new property Content will be available where you can select the file collection to zip and upload. The Remote Path property must return the path on the shared Google Drive including the file name of the uploaded ZIP file.