In this article we will give you a short explanation on how to create a Google Drive Connector in your portal.


Note: You will need a Google service account for this. A service account is a special type of Google account intended to represent a non-human user that needs to authenticate and be authorized to access data in Google APIs.


You can use the Google Drive connection to upload various datafiles for use in the portal, be it a datafile of your customers to send out invites or adding additional background information, such as information about the respondent, products and/or services they purchased, to the data already present in the database.



Table of contents:


General

CYS provides 7 different ways of importing data into your portal:


  • Via manual upload
  • Via SFTP
  • Via OneDrive
  • Via Google Drive
  • Via Dropbox
  • Via Box
  • Via an API connection


For each option you will find an explanation in our Knowledge Base. This article is about setting up the Google Drive Connection.


Google Drive

To add an import that automatically uploads data via Google Drive to your portal is as simple as adding any other import source.

The configuration for a Google Drive connection requires a few items:

You will need a working Google account. The Google account can be a personal or corporate account. 

Google Service Account

To set up a Google Service Account, you will first be asked to use or create a project in your Google account.

To use the integration, you need a Google Service account. You will first be asked to use or create a project in your Google account.

Note: The procedure for creating a Google Service account can be found here:  
https://cloud.google.com/iam/docs/creating-managing-service-accounts


The service account is represented by a google email address. After setting up the service account you can share a folder in Google Drive with your portal. After creating the Service Account, you need to grant access to the Google Drive API.


Note: The procedure for granting access to Google Drive API can be found here:
https://developers.google.com/drive/api/guides/enable-drive-api


Finally, you need to create a secure Json Key to give access to the GDrive folder.

Key

Below you can see an example of generated json Key.

Text, application

Description automatically generated

GDrive

You need to set up a folder in Google Drive for importing files to CYS. After creating the folder, you need to give the Google Service Account access to that folder. The created Key shows the email address which should be used for giving access to created GDrive folder. 

In the example of the Key you can find the email address. In this example it’s "gdrive-service-account-for-cys@cys-gdrive-integration.iam.gserviceaccount.com".

Once the preparations in your Google Drive account are done, you can setup the import source within your CYS portal.


Adding the import source to your portal

  • Open your portal and in the left-hand pane click DATA GARDEN (1) to open the dropdown list. 

    Click Sources (2).

  • Click the Add New Source (3) button on the top right of your screen.


  • Select Connectors & Integration (4) and use the previous / next buttons to scroll through available options. 
  • When you come to the Automatically upload through Google Drive option, click the Add (5) button.

Graphical user interface, application

Description automatically generated

  • A pop-up will appear where you need to enter a name for your import source. After doing so, click Add.
  • The source will be added to your portal.
  • Click the SOURCE (6) button of the import source you just added.

 



Graphical user interface, application

Description automatically generated


Click the Definitions (7) tab.

Here you can add the columns of your datafile. You can do this manually or by uploading a sample datafile. The file can be an Excel file or a CSV file. We recommend using a sample datafile to add the columns to your import.


 For more information about Setting up an import, please read the Defining the columns article.

 

After adding the column definitions to your import source, four new tabs will be available to you; File Sources, Rules on Import, Data View and Log (8). Click the File Sources tab. To connect your import source to Google Drive, you need to copy / paste the security json credentials of your Google Drive service account and the direct path where the files are added. This can be the name of the shared folder, or a folder underneath. It should always be just the name of a single folder, not a full path.

 

Graphical user interface, text, application, email

Description automatically generated

 

Once a file is placed in the folder that matches your import rules, it will be automatically picked up and processed into your import slot. The filename will be edited to indicate that it is processed.