Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Create service account for the project

  1. Go to https://console.developers.google.com/projectselector/permissions/serviceaccounts
  2. Select a project. You can create a new one too if you do not have one yet (e.g. jogetsample).
    Image Added
  3. Click on Create Service Account.
    Image Added 
  4. Name the service account (e.g. jogetsample).
    Remember to check Furnish a new private key and also Enable Google Apps Domain-wide Delegation. Press Create.
    Image Added 
  5. A .json file will be downloaded. Open up the file in your favorite text editor.

Enable Google Drive

...

API for the project

  1. Go to https://console.developers.google.com/apis/library
  2. Make sure that your current project is selected (e.g. jogetsample).
    Image Added 
  3. Click on Google Drive API.
    Image Added 
  4. Enable it.

Delegate Google Drive access to the project service account

  1. Go to https://admin.google.com/AdminHome?chromeless=1#OGX:ManageOauthClients.
  2. From the downloaded JSON file earlier, copy the "client_id" and put into the Client Name field.
    Image Added 
  3. In the field  

     
    Code Block
    https://www.googleapis.com/auth/drive.file
      
  4. Click Authorize.

Configure Joget Workflow App

  1. From the downloaded JSON file earlier, copy the "client_email" and "private_key" values.

  2. In your Joget app, select Google API Configuration in Properties & Export -> Set Default Plugin Properties

  3. Key in the value of "client_email" value into OAuth 2.0 Client ID, and value of "private_key" into OAuth 2.0 Client Secret, then Submit.

    Image Added

Google Drive Form Element

  1. With the steps above done, you are now ready to use the Google Drive File form element.
  2. Just configure on which user's Google Drive you want to store to and name the folder accordingly.
    Image Added
  3. Files uploaded will follow the same folder structure as the native File Upload element. Here's the sample screenshot in Google Drive.
    Image Added