Page tree

Agiloft Google Drive Integration

Integrate your Google Drive files directly with your Agiloft workflows for easy editing and sharing using the very latest version of the file. Connecting directly to your files makes it possible to move seamlessly between Agiloft and the Google Suite.

This page walks you through the configuration and setup to plug Google Drive directly into your KB.

Prerequisites

Before you set up the integration, make sure popups are allowed in your browser settings.

Setting Up the Google Drive Integration

To set up the Google Drive integration, start by configuring Google to add an OAuth client and service account for the Google Drive API. When users initiate file editing from Agiloft, the system accesses Google Drive as the service account. This simplifies permission management because you don't have to grant users direct access to the drive, and it ensures users can't view files on the drive that they can't view through Agiloft. 

Set Up Google

Complete the steps below to set up an OAuth client and service account for Google Drive.

If the options you see in the console or your practices for adding OAuth 2.0 clients differ from those described here, refer to Google's documentation on OpenID Connect to complete the task.
  1. Log into the Google Cloud Platform Console as an administrator and go to APIs & Services.
  2. Create a new project:
    1. At the top of the screen, click the current project name to open the Select a resource dialog box.
    2. In the dialog box, click New project.
    3. Enter a project name, such as Agiloft Google Drive, and change the Organization and Location if needed.
    4. Click Create. After the project is created, make sure it's selected at the top of the screen.
  3. Next, enable the Google Drive API in the project:
    1. At the top of the Enabled APIs & services screen, click Enable APIs and Services.
    2. In the API Library, search for and select the Google Drive API, then click Enable. The API/Service Details for the API are displayed.
  4. Now, create service account credentials for the API. For information about service accounts, refer to Google's documentation on using OAuth 2.0 for server-to-server applications. 
    1. Click Credentials in the sidebar.
    2. Click Create Credentials at the top of the screen and select Service account.
    3. Under Service account details, enter a Name for the account, then click Create and Continue. Google creates the account and returns to the Credentials screen.
    4. Under Grant this service account access to project, click Select a role and select Owner, then click Continue.
    5. Under Grant users access to this service account, optionally grant users permission to act as the service account or administer the account, then click Done. Google updates the account and returns to the Credentials screen.
    6. On the Credentials screen, click the new service account to view its details.
    7. On the details page, click the Keys tab.
    8. Click Add Key and select Create new key.
    9. For the Key type, select JSON and click Create. The JSON file containing the key is downloaded to your computer. You refer to this file later in the setup. 
  5. Next, exit the service account details and go back to the Credentials screen.
  6. Now, configure the consent screen for the project. For information on consent screens, refer to Google's documentation on setting up consent screens.
    1. In the left sidebar, click OAuth consent screen, then click Get Started to configure the project.
    2. Under App information, enter the name of the application, such as Agiloft.
    3. In User support email, select the email address where users can get support, then click Next.
    4. Under Audience, select Internal to limit access to the app to users within your organization, then click Next.
    5. Under Contact information, enter the email address where Google should send project notifications, then click Next.
    6. Agree to the Google API Services User Data policy and click Continue.
    7. Click Create. The OAuth Overview is displayed.
    8. Next, click Branding in the sidebar. For information on branding, refer to Google's documentation on managing OAuth app branding. 
    9. For the App domain settings, you can enter the following URLs for Agiloft's home page, privacy policy, and terms of service:
    10. For Authorized Domains, add each applicable domain:
      • Add your company domain.
      • If your KB is in the agiloft.com domain or you included Agiloft URLs in App domains, add agiloft.com.
      • If the domain for your KB is not agiloft.com or your company's domain, also add the KB domain.
      • Click Save to save the changes.
  7. Next, create an OAuth web client:
    1. In the left sidebar, click Clients and click Create Client.
    2. For Application type, select Web application.
    3. Enter a Name for the client, such as Agiloft Client.
    4. Leave Authorized JavaScript origins blank.
    5. Under Authorized redirect URIs, click Add URI and enter the following URI: https://DOMAIN_NAME/ui/oauth20callback. Replace DOMAIN_NAME with the domain for your KB. For example: https://example.agiloft.com/ui/oauth20callback.
    6. Copy the Authorized redirect URI to a note to use later in the setup.
    7. Click Create.
    8. Once the client is created, copy the Client ID to your note. In addition, view the client details and copy the Client secret value to the note.
  8. Complete any other optional client configuration as needed. Agiloft client does not require specific Data Access scopes.

Now that the application is configured in Google, you can set up the integration in Agiloft.

Set Up Agiloft

Follow the steps below configure Agiloft to connect to Google Drive. You set up an OAuth 2.0 profile for the OAuth client you created and integrate the service account for file access.

  1. Go to Setup > Access > Configure OAuth 2.0 Profiles.
  2. Click New to add a profile.
  3. Leave the "Use full OAuth account name as a KB login name / email" checkbox selected.
  4. Enter a name for the OAuth 2.0 provider, such as Google.
  5. For the role of this OAuth 2.0 Provider, select Google_APPS.
  6. Complete the remaining fields:
    1. Redirect URI: Overwrite the default value with the Authorized redirect URI you noted when you set up Google. For example: https://example.agiloft.com/ui/oauth20callback
    2. Client ID / Application ID / Consumer Key: The Client ID from your note.
    3. Client / Consumer Secret: The Client secret from your note.
  7. Click Finish to save the profile.
  8. Now, open in a text editor the service account key JSON file you downloaded from Google, and integrate the account with Agiloft:
    1. Go to Setup > Integration.
    2. Under Google Service Account Integration, click Configure.
    3. Complete the fields by copying and pasting the appropriate values from the JSON file. Do not include the quotation marks.
      1. Project ID: The project_id value from the JSON file.
      2. Private Key ID: The private_key_id value from the JSON file.
      3. Private Key: The private_key value from the JSON file, starting with -----BEGIN PRIVATE KEY and ending with END PRIVATE KEY-----\n.
      4. Client Email: The client_email value from the JSON file.
      5. Client ID: The client_id value from the JSON file.
  9. Click Finish to save the configuration.

The last step is to configure the file attachment fields in Agiloft to connect to Google Drive.

Configure File Attachment Fields

Finally, configure the system to open attachments in Google Docs. To do so, you need to create or reconfigure all File with Versioning Fields that hold attachments that should be opened with Google Docs. For example, the Attached File field in the Attachments table is a File with Versioning field.

  1. For the table that contains the File with Versioning field, go to Setup [Table] and open the Fields tab. 
    1. Edit the File with Versioning field.
    2. Go to the Options tab.
    3. Under Application for direct editing, select Google Docs. This means all Google Docs, as well as any .docx or .xlsx files, will be opened using the Google Suite.
    4. Under Allow Google Documents, select Yes.
    5. Click Finish.
    6. If you have other tables that contain fields with attachments that should open in Google Docs, repeat these steps for those tables. 
  2. Now, test the field configuration change by opening an attached document in a record. Opening a document for editing automatically creates a new folder on Google Drive for Agiloft documents.  
    1. Go to one of tables where you configured a File with Versioning field and open a record with an attachment in the field. Testing one field is sufficient at this time. You don't have to repeat these steps for each field you modified.
    2. Click the attached document and select Checkout to Edit.
    3. If you're prompted to sign in with Google, sign in. 
    4. If you're asked to consent to giving Agiloft access, click Allow.
    5. Click Continue. The file is opened in Google Docs.
  3. Now that the file is open in one tab, open the Google Drive application in another tab so you can view the contents of the drive.
    1. In Google Drive, locate a new folder called agiloft_documents and open it.

      The name of this folder is defined by the GDrive Agiloft folder name global variable.

    2. Click the menu icon next to the folder name and select Share.
    3. Give the Google Service account access as an Editor:
      1. Open the service account key JSON file you referenced earlier in the setup.
      2. Copy the email address in client_email.
      3. Add the client email address to the Share dialog box.
      4. Make sure Editor is selected in the drop-down list.
      5. Clear the Notify people checkbox.
      6. Click Share. If you get a message saying the service account is external to the organization, click Share anyway.

Your Google Drive integration is now complete. You can open files directly in Google Docs from Agiloft, as well as have document edits automatically synced across platforms. Next, you can deploy the Agiloft add-in for Google Docs. See Configuring the Agiloft Google Docs App for instructions.

Legacy Integration

This section describes the legacy Google Drive integration, which is less powerful and no longer recommended. These steps are included for you to reference if you already have this integration configured, and you need to troubleshoot that existing configuration.

Enabling Google Drive in File Fields

  1. Open the file field wizard by navigating to [Setup Table] > Fields > [Edit the field].
  2. Navigate to the Options tab.
  3. Select Yes under Allow Google Documents.
  4. Press Finish to save.

Managing Google Documents

To attach a document stored in Google drive:

  1. Open the record where you want to attach a document, then locate the file field.
  2. Click Attach/Manage.
  3. In the Attachments window, choose one of the options in the External Source Google section:
    1. New Document/Spreadsheet/Presentation - enter a document name and click Create.
      1. Authenticate your Google login details. 
      2. Grant the necessary access rights to the system.
      3. In the document window that opens, create the new document. The document will be saved as you work. 
    2. Attach existing Doc/S/P - the Attachments window opens, and the docs list will be populated with all of the existing documents in your drive. This may take some time if you have a large drive folder. 
      1. You can search for documents by entering the name and clicking Search.
      2. Or select a document in the list.
      3. Or enter the URL of a document in your drive and click Find, then select the result.
      4. You can also create new documents in this screen by selecting a document type under the Create New section and following the same steps as above. Then enter the new document's URL into the existing URL field and click Find. The new document will appear in the file list for selection.
      5. Select the relevant document and click Attach.
    3. Upload Local File - click Choose File to select an Office or Google Docs file from your desktop.
      1. Click Upload.
      2. Authenticate your Google login details. 
    4. The new document will be saved in the Attachments file field, and clicking the attached file will open it in Google Docs. 

Disabling Google Drive in File Fields

If you do not want users to see the options to attach Google documents, you can disable the Google integration in the file field wizard. To do so:

  1. Edit the file field in question by navigating to [Setup Table] > Fields > [Edit the field].
  2. Navigate to the Options tab.
  3. Select No under Allow Google Documents.
  4. Click Finish.