Skip to content

Set up Google Drive jobs

Walks through preparing a Google Cloud service account so that a Report Generation Job can deliver report PDFs to a Google Drive folder.

For the wizard fields and how Google Drive delivery fits into the rest of the job (parameters, repeating data sources, scheduling, hold-for-review, etc.), see the Google Drive delivery section of the Report Generation Jobs page.

Setting up a Google Service Account

  1. Go to Google Cloud Console and sign in with your Google account. If you do not have a Google Cloud project, create one by clicking on "Select a project" and then "New Project".
  2. Click on "APIs & Services" in the sidebar, search for "Google Sheets API" and enable it. Do the same thing for "Google Drive API". Return to the homepage after this step.
  3. Under "IAM & Admin" in the sidebar, select "Service Accounts" and click on "+ Create service account" to initiate the service account creation process. Provide the name of the account. You can skip optional sections.
  4. Account that you have created will appear in the table on "Service Accounts" dashboard, select the account and navigate to "Keys" tab, select "Add Key" followed by "Create new key" option, the "Key type" should be "JSON". Selecting "Create" will create the key and will prompt you to download the json file. Make sure to download it as you will need this later.

Warning

Navigate to a google drive that you want to use as a storage for reprots from CxReports and share it with the email of the Google Service Account that you have created.

Setting up Google Service Account in CxReports

  1. After logging in, navigate to "Google Cloud" option under "Workspace Configuration" in the navigation menu and click on "+ Add New Service Account"
  2. Fill out the form with necessary information:
    • Name: Name of the Google Service Account within the CxReports environment
    • Email: Email of the Google Service Account that you have created in the first step of this tutorial
    • Scopes: Enable the scopes (both Google Sheets and Google Drive will be enabled/disabled simultaneously)
    • Key (JSON): Copy and Paste the contents of the JSON key that you have downloaded during the first step of this tutorial
  3. Select "Save"

Adding a Google Drive delivery to a job

The full wizard walkthrough lives on the Report Generation Jobs page — open a job, reach the Delivery step, and click Add Google Drive. Two fields are easy to get wrong, so they are spelled out here:

  • Folder Id — find it by navigating to the target folder in Google Drive and copying the ID from the URL. Example: https://drive.google.com/drive/u/0/folders/1lcVUmXDIXRgcA00UNeLJyJhPXkPYKMMg
  • Subfolder Path (optional) — creates a subfolder inside the target folder. Supports CxJS expressions, so you can produce dynamic paths. For example, {[new Date()]:dt;YYYYMMMdd} creates a subfolder named after the current date.

The service account configured above must have write access to the target folder (or one of its parents). If access is later revoked, the delivery fails and the entry's delivery status reflects that.