Page tree

SharePoint Integration

Agiloft offers a SharePoint integration that allows users to collaborate easily within any Microsoft document. With this integration, when you click Checkout to Edit on a SharePoint file, it opens in Microsoft Word without locking the file, allowing the concurrent editing that makes SharePoint a convenient file storage solution. 

Integrating SharePoint with Agiloft doesn't automatically give Agiloft access to your entirety of SharePoint documents. Instead, Agiloft can only access files in SharePoint that can be opened from, for example, an Attachment record in Agiloft. You can choose whether files are stored in an existing SharePoint folder that you designate yourself, or a new folder that is created automatically during the integration. Files are not automatically updated in Agiloft when saved in SharePoint. Instead, updated versions are actively fetched from SharePoint when needed.

Consult the following sections to set up the SharePoint integration.

Register Agiloft with Microsoft Entra

This integration requires Agiloft to be registered in Microsoft Entra ID. Microsoft Entra ID is a cloud identity and access management solution. Registering the Agiloft application provides access to the Microsoft Graph API, which allows communication with SharePoint. 

To register the application:

  1. Follow this official guide from Microsoft to set up a Microsoft Entra tenant. This requires an Entra (formerly Azure) account that has an active subscription.

  2. Follow this official guide from Microsoft to register the Agiloft application with the Microsoft Identity Platform (Microsoft Entra ID).

    1. In step 5 of Register an application, for "Supported account types", select "Accounts in this organizational directory only (Contoso only – Single tenant)". This generates a tenant ID which will be used later when setting up the SharePoint OAuth 2.0 profile in Agiloft. Copy this value into a document for reference in a later step.

    2. In step 4 of Configure Platforms, choose Web. To get the redirect URI value:

      1. Login to your Agiloft KB in another browser tab.
      2. Navigate to Setup > Access > Configure OAuth 2.0 profiles > New.
      3. Use the auto-populated value in the Redirect URI field.
    3. Back in Entra, click Register. Take note of the Application (client) ID value and copy it into the reference document you created in step 2a.
    4. In the "Add credentials" section of the guide, follow the steps to add a client secret. Copy the client secret into your reference document. 

      Make sure you record the Client Secret value. It is not accessible after you leave this page.

  3. When you finish, your reference document should include the tenant ID, application (client) ID, and client secret. If you did not copy the tenant ID already, navigate to the overview page for your application to find it.

Configure the Microsoft Graph API

Next, grant permissions to Agiloft so that it is authorized to call the Microsoft Graph API, which is a SharePoint requirement

Follow the official guide from Microsoft, using the following to complete the steps:

  • For Delegated permissions, please choose “offline_access”, “User.Read”, “Sites.ReadWrite.All”.
  • For Application permissions. choose “Sites.Manage.All”, “Sites.ReadWrite.All”, “User.Read.All”.
  • Grant administrator consent for permissions that require it.

Setting up the SharePoint Integration in your KB 

Once you've registered Agiloft with Microsoft Entra and configured the Microsoft Graph API, you can complete the integration in your KB.

  1. Navigate to Setup > Access > Configure OAuth 2.0 Profiles.
  2. Click New to add a new profile.
  3. In the OAuth 2.0 Identity(Auth) Provider Name field, enter: SharePoint
  4. In the The role of this OAuth 2.0 Provider field, choose the SharePoint_OAuth option. 
  5. In the Redirect URI field, confirm the auto-populated value is the same as the one used when registering the application in Microsoft Entra ID.
  6. In the Client ID / Application ID / Consumer Key field, enter the application (client) ID you recorded earlier. 
  7. In the Client / Consumer Secret field, enter the client secret you recorded earlier.
  8. In the Authentication URI field, enter: https://login.microsoftonline.com/common/oauth2/v2.0/authorize
  9. In the Tenant Id field, enter the tenant ID you recorded earlier.
  10. In the SharePoint Site field, enter the URL of your SharePoint site. This is the site Agiloft uses to locate and save or open your files. Your Agiloft user email address must be a member of this site. An example URL value might be: https://21dz27.SharePoint.com/sites/dev
  11. In the SharePoint Folder Name, enter a name for the folder where Agiloft will upload documents before they are opened to edit. If the folder does not exist, Agiloft will create it in the SharePoint site when you complete the setup. Agiloft also creates one subfolder for every attachment to ensure there are no repeat file names in the main folder.
  12. Click Finish.

Now that you have connected Agiloft to SharePoint, you need to enable specific File with Versioning fields to use SharePoint:

  1. Navigate to Setup [Table] for the table that contains the documents you would like to open and edit in SharePoint. For example, the Attachments table.
  2. On the Fields tab edit the File with Versioning field that holds your documents.
  3. On the Options tab, select SharePoint under Application for direct editing.
  4. Click Finish to save the field and then Finish to close the table wizard.
  5. Repeat these steps for any other file fields you want to integrate with SharePoint.

Finally, make a few more adjustments to make SharePoint files compatible with the Agiloft Word app.

  1. Navigate to Setup [Attachments] and go to the Actions tab.
  2. Click Modify Action Document to create a new action.
    1. Name the action SharePoint Modification and click Next.
    2. For both the source and destination fields, select Attached File.
    3. Select the option to overwrite existing files.
    4. For the option to add properties to the XML layer, select Yes.
    5. Click Finish.
  3. Return to the Actions tab, edit I: All Create Actions, and go to the Details tab.
    1. Click Add Action.
    2. Select the new SharePoint Modification action and click Finish. This way, this action runs every time a new attachment is created, and allows SharePoint files to communicate with the Word app.

You have now completed the setup for SharePoint integration, and can start using SharePoint to edit your documents.

Tracking SharePoint File Versions in Agiloft

With the SharePoint integration, Agiloft does not automatically maintain file versions, and you need to use SharePoint to track and review file history. If you would like to store specific versions of the file in Agiloft for future reference or use in document comparison, follow the steps in this section to set up file snapshots in the Attachments table.

Note that versions that are required for future reference must be manually saved before they are edited further.

  1. Navigate to Setup [Attachments].
  2. On the Fields tab, go to New > Choice.
    1. Name the field Snapshot? and select the Yes/No choice list.
    2. Go to the Display tab and click Finish.
  3. In Setup [Attachments], go to the Conversion tab and edit the Create Revision File conversion.
    1. On the Field Mapping tab, scroll to the bottom and click Add Formula Mapping.
    2. Enter the value "Yes" with quotation marks and map it to the Snapshot? field you created.
    3. Click Finish.
  4. Return to the Fields tab and go to New > Action Button.
    1. Name the field Create Snapshot, or something similar. This text appears in the record form, so choose the phrase you want to train users to look for when they need to manually save a version of a file.
    2. Set a display option.
    3. Before executing actions, select Do nothing.
    4. Select the Execute Actions checkbox and select the C: Create revision action, which runs the conversion you modified in step 3.
    5. After executing options, select Save record.
    6. Go to the Options tab.
    7. Under Make the visibility of this field conditional, click Add Condition.
    8. Select the Snapshot? field you created and select No from the value list.
    9. Click Finish twice.
  5. Scroll down in the I: All Create Actions list and remove each of these sections:
    • if (Supersede Old Versions='Yes'): Remove this if statement and its contents.
    • if (Previous Attachment ID!=NULL): Remove this if statement and its contents.
    • if (Baseline Contract File!='$NULL' and Attached File~='.docx' and Source Attachment ID for Revision!=NULL): Remove this if statement and its contents.
    • if (Baseline Contract File ID=NULL): Remove this if statement and the action it contains. Do not remove the if statement that contained it.
  6. Click Finish.
  7. Go to the Rules tab and select the "Edit: Create new revision document..." and "Edit: When marked up baseline changes..." rules.
  8. Click Disable at the top to disable both rules.
  9. Edit the "Create: All create actions except OCR" rule.
  10. Go to the Actions tab and remove the I: Create Clause Modifications if First Revision action.
  11. Navigate to Setup [Contracts] and go to the Fields tab.
  12. Edit the Contract Attachments related table.
  13. Go to the Permissions tab.
  14. Under Additional filters, select "a saved search" and create a new search.
    1. Click Simple to add a Simple filter.
    2. Select the ID field in the second drop-down.
    3. Select the "greater than or equals, >=" operator.
    4. Select Value and enter 1.
    5. On the Sorting tab, set the order to ID, ascending.

You might want to make a few additional changes for usability:

  1. Navigate to Setup [Attachments].
  2. On the Fields tab, edit the Previous Attached File linked set.
    1. On the Fields tab of the linked set, update the field names to use snapshot terminology instead of "previous" – for example, replace Previous Attached File with Snapshot File.
    2. On the Options tab, under Restrict the Attachments?, edit the saved search.
    3. In the row listing the ID field, change the operator to "is greater than, >".
    4. Go to the Options tab, give the new search an appropriate name, select "Save as new saved search," and click Finish.
    5. Confirm the new search is selected under Restrict the Attachments?, then go to the Display tab and click Finish.
  3. Still on the Fields tab, edit the Compare to Previous Attachment action button and rename the button text to Compare to Snapshot.
  4. Click Finish twice and go to the Attachments table.
  5. Go to Views > Manage and edit View in Contract.
  6. Add the Create Snapshot button to the view.