SharePoint Integration

Purpose: Display a list of files, stored in Microsoft SharePoint, that are related to a specific case in LegalServer. A folder is created in SharePoint for each case and those files are availble in LegalServer. LegalServer will also save files to that folder instead of LegalServer document storage. 


Cost: $4500 one-time setup fee and $100 per month. Additional support hours are available for setup beyond the included details. Non-standard configurations as described below may require additional costs. Migrating documents to Sharepoint from your existing setup is an additional hourly cost.


Video: Working with SharePoint


Requirements:  Microsoft Azure, Microsoft SharePoint (cloud version only)

Included in the Integration

Purchasing the integration means:


Additional Support 

Additional support hours (purchased separately) are available for:


Document Migrations:

Please reach out at least a month in advance of when you want the document migration to happen. This work is developer intensive and requires us to plan for their time well in advance. 

SharePoint Setup

General Configuration Requirements


Agencies will need to share a set of Global Administrator Credentials with LegalServer for their SharePoint instances. Agencies should send those via the Secure Messaging Tool.  LegalServer staff will create the Azure Authentication Apps in your Azure environment. For organizations that do not wish to share Global Administrator credentials with LegalServer, we will provide your Azure administrators with a detailed Technical Guidance Document with step by step instructions on creating and approving the Authentication apps. LegalServer will still need a standard user account to ensure things are working. 


Site Setup

Agencies will also need to identify the default libraries to connect with their Live and Demo sites. These can be in the same SharePoint site or separate sites depending on the Agencies preference. The libraries should not be the same for both the Live and Demo sites. At least one library needs to be identified as the default per LegalServer site.


WARNING: SharePoint cannot expand indefinitely. Please plan to use the Multiple Libraries feature at some point. SharePoint has limits on the number of documents in a folder before it will not display in the User Interface (5000 items), the number of items in a SharePoint list/library before they will stop indexing (this is not well documented -- 5000 items is the documented limit, but in practice it appears closer to 500,000 items), total size of a SharePoint subsite (25,600 GB). LegalServer clients have run up against all of these limits. The best way to avoid them is to plan for multiple libraries and potentially multiple subsites. Some groups divide their libraries based on year open, subject matter, office, or program. 


Destination Libraries

To configure the multiple library setup, you have to start by adding all the sites/libraries to a system lookup - SharePoint Site Library. Plan to include the default location in addition to any additional Sites or Libraries you want to have available.

The name will be viewed in the actual lookup field on your site, so make sure it is descriptive. Both Site Path and Library path should start with a forward slash ("/"). All SharePoint Libraries should be within the same Microsoft Domain/Tenant (i.e. all the URLs start with https://legalserver.sharepoint.com). To figure out what part of the URL goes into the Site Path versus the Library Path, consider the following example - https://legalserver.sharepoint.com/sites/ms-demo/test%20library%202/Forms/AllItems.aspx. The green part is the Microsoft Tenant and not used in the lookup. The teal part is the Site Path and the red part is the Library Path. Finally, the orange part is also not used. Note that spaces need to be replaced with %20. If they are not replaced with that, then the folder will show but none of the documents in the folder will display. 


Note that adding libraries and sites to this lookup is validated. If the site or library do not exist, you will get an error. You will also get an error if you are using the limited access configuration for the Active Directory authentication apps and the app does not have access to the site. 


Organizations need not share anything beyond the default SharePoint Site and Library with LegalServer to activate the integration. If you only wish to have one library, the default is enabled by the LegalServer Developer without needing to modify this lookup. If you want the ability to use multiple libraries/sites, you'll need to also add your default library to this list to be able to save there in addition to other places. 


This lookup is then used by the SharePoint - Create Folder block to identify where the case folder should be created. The Create Folder block will store the location in the system field of "SharePoint Folder Site and Library" on the specific case file. The block will set that value only if that value is not already set.  


Recommended configurations include setting a record for the default library in this lookup.


SharePoint Authentication

See the section on SharePoint Permissions below for further details on how these are used.

App-Only Authentication

SharePoint authenticates with sites in two ways. The first is App-Only Authentication. This is a global set of credentials that allows LegalServer to display a list of files for the case without the end user logging in. This is used to create case folders, the Drag and Drop features on to the SharePoint Documents block to upload files, and the store emails in SharePoint feature if that is enabled. When this is used, the individual user's data is not included as the file creator. 


User Authentication

Individual user authentication is used for other methods of uploading documents to SharePoint. This includes Document Templates, Adding a Document with Case Notes, the Static Add Document form, or the Search for Documents feature. In any of these instances, you will see a "Login to SharePoint" link first. Once you click that and then sign in if necessary, the end user will have a User Authentication token to use any of these features. Documents uploaded via these methods will show as though uploaded by the specific user. User authentication depends on that user's access to the relevant SharePoint Site and Library. If they don't have permissions to create a file in that library, it will generate an error. 


SharePoint Features

SharePoint Documents Block

An administrator will need to add the SharePoint Documents block to a case profile once the SharePoint add-on has been activated:

The SharePoint Documents block has a few configuration features to identify. 


The configuration options for the site/library location can be safely ignored. 


With the SharePoint Document block, you are able to also drag and drop files directly into SharePoint from your desktop. Dragging files into subfolders highlights the subfolder's row and not the whole set of documents, LegalServer will automatically rename the file to remove any special characters. If a file is uploaded via drag and drop and one with the same name already exists, you will be prompted before it is overwritten. File uploads are currently limited to 50mb through LegalServer. Larger files may be uploaded through SharePoint directly. 


In the SharePoint Document block, clicking on any of these links will take the user to the web version of Microsoft Office, depending on the user's own settings and which Microsoft products you have made available to users.  It is not controlled by LegalServer but by the user's browser and device settings. The documents displayed are now sortable by name or modification date -- Ascending/Descending and Within Folders/Altogether. Sorting by Modification Date is purely looking at all files and then sorting regardless of folder. To reset the list to the default sort, click the reset filter button in the top right, reload the page, or click the Sort by Filename option four times. 


SharePoint - Create Case Folder Block

The create SharePoint folder block will need to be on both the Intake Process (for new cases) and an Aux Process (for existing cases). Case folders will be created with the case number of the case as the folder name. Currently, changing the name of that folder will break the relationship. 


If you are using Multiple Library/Sites, the SharePoint - Create Case Folder block will now have the ability to "Set SharePoint Site and Library". If left as "No", the lookup is not shown and the folder will be created on the default SharePoint Site and Library (the block will show the library and site paths as read-only text for reference). If you say "Yes", you'll have a lookup to select which location should the library create the folder in. 

This lookup is setting the system field of "SharePoint Folder Site and Library" that saves the location of the SharePoint Folder on the specific case file. The block will only set this new system field the first time it is run. If the system field is already filled out, you will need to change the field outside of the SharePoint - Create Case Folder block. This field can be set before the SharePoint - Create Case Folder block is run the first time. This field controls where the SharePoint Documents block looks for the folder. If it is blank, then it will look in the default location. If it is filled out, then that is location the listview will look. Regardless of what is configured on the SharePoint Documents block, it will look at the library set by this field if it is set.


Note it is recommended to always set a SharePoint Site and Library value, even if it is just to the default lookup value.


The SharePoint - Create Case Folder block must be configured to select the same library as the system field or no new folder will be created in the intended Library. Submitting a version that does not have it set will create a folder in the other location instead (or in addition). 


Uploading Files 

When creating a file using a New Style Document Template within LegalServer, it will automatically save to SharePoint. You will have to be logged into SharePoint for this to work. If you are not logged in, you will be prompted to log in to do so. Currently, all Document Templates will save as RTF files, although there is a flag when editing the document that allows you to have LegalServer convert the file from RTF to DOCX. There are no guarantees about the formatting after the conversion, so test in advance. Alternatively, you can create a Power Automate function that will convert all of the RTF files to DOCX files if you want to extend the functionality and make the generated documents editable in Word Online. Old Style Document Templates will not save to SharePoint. 


Uploading a file via adding a Case Note will add that file to SharePoint. Using the Static Add Document form will also save it in SharePoint. 


Uploading a file via the Attestation on File, Retainer on File, and Affirmative Litigation blocks (all that collect documentation for LSC compliance purposes) will save the document to both LegalServer and to a Compliance subfolder of the case in SharePoint.


Emails to a case require LegalServer Developers adding a configuration flag to your site. Email Support or open a ticket to enable that feature. This would add automatically save the email and any attachments to SharePoint but the attachments will not appear in Case Notes. The text of the email is still parsed for the Case Notes. If a SharePoint folder does not exist for the case, one will not be created. Then the email will be handled as though SharePoint is not configured. 


Immigration forms will automatically save the generated forms to SharePoint. 


Other blocks (Add Document, Add Document with Title, Discovery, Activities, etc.) will not upload to SharePoint. As other blocks begin saving to SharePoint they will be identified. 


The Guided Navigation Action: Generate a Document will save to SharePoint if the SharePoint folder already exists. This element cannot be combined with an element that changes the SharePoint Site and Library value because the value will change first and then LegalServer will not find a SharePoint folder in the new library, causing the document to save to LegalServer instead of SharePoint. You may need to check the box to show the document link. Even so, if you don't want the link to display, set the document to generate when the segment is saved instead of when it is displayed. This will always use the App Authentication.


Once you are logged in as a user to SharePoint (having clicked the "Login to SharePoint" link in LegalServer), the Document List block will offer a SharePoint icon to move a file from LegalServer to SharePoint. Clicking this link will upload the file and refresh the SharePoint Documents block. 

Beta Features

There are two features regarding the SharePoint Documents list that are currently in Beta. These features can be enabled upon request. They are not in active development, so discovered bugs are not likely to be addressed immediately.

SharePoint Permissions 

Permissions within SharePoint are managed within SharePoint.  Access to opening files from SharePoint will depend on SharePoint permissions. LegalServer does not set any special permissions or access beyond what is inherited by the case folder. LegalServer does not administer anyone's SharePoint sites and libraries. 


If you want to enforce any custom access rules in SharePoint, you will need to consult with a SharePoint expert if you want to leverage information from LegalServer APIs into any business processes or rules. The other option is to set different rules based on the Library and create folders in different libraries. 


SharePoint Configuration Options


LegalServer Config Flags

There are multiple config flags that are typically enabled in a new setup of this integration. These can be turned on or off individually by LegalServer Support. 


The Beta Features mentioned above are also configuration flags that can be set. 


There is an additional config flag that can be enabled if needed:


Switching/Moving the SharePoint Folder

Top level case folders can be moved from one connected library to another connected library. They cannot be moved into subfolders or non-connected libraries. This requires two steps.

Note that there is a way to combine these steps using Power Automate as discussed below. 


Multiple Library Configuration Suggestions

One option is to have a process with the new SharePoint Folder Site and Library field as the toggle field for branch logic. On each branch logic form you have the SharePoint - Create Case Folder block set with the destination library. 


The block is also available in Guided Navigation. You can use the logic evaluator in Guided Navigation to determine when you are creating a SharePoint folder in a given library. If you are using the SharePoint Site and Library field's value as your filter in the logic evaluator, that field's values need to be set before the dialogue offers the Create SharePoint Folder block. It can either be on the first segment with the Create SharePoint Folder block being on a second segment, or it needs to be set on a form before the form that holds the Guided Navigation dialogue. If you use a different field for the logic evaluator, you do not need a second segment in the Guided Navigation. 


Another option is to have separate Auxiliary Forms and Processes for each destination location. 


Integration and Report Details

Reports

The only field in LegalServer reports that may indicate whether a case has a SharePoint folder or not is the SharePoint Site and Library lookup available on the Case Data table. If that field is left to the default and not set, there is no way to indicate if a SharePoint folder exists on the matter record. Alternatively, if you have the Create Case Folder results stored to case notes, you can filter for that case note. 


APIs

LegalServer has a free API that allows you to interact with the SharePoint Site and Library Lookup. You can look at a full list of the values, add a new value (with the same validation as in the UI), and modify existing values


On a site that has SharePoint enabled, the SharePoint Site and Library value on a case will be returned in the Search Matter API and the Get Matter Details API. If you have Premium APIs, you can also set this value when you either create a case or update the case. Setting the value will not trigger the SharePoint Create Folder feature, there's a separate API endpoint that will do that. The endpoint to create the SharePoint folder is also a Premium API.  


PowerAutomate and LegalServer's SharePoint Integration

One benefit of SharePoint is the ability to add in other aspects of the Microsoft suite of tools. PowerAutomate is utilized in the examples below as tested in December 2022. LegalServer is not a Microsoft partner nor a consultant in how to use Microsoft tools. Microsoft's products change over time so these examples may not be a perfect match to Power Automate if you go to set them up. LegalServer strongly recommends testing these on your Demo Site and Library first before enabling on your Live site and SharePoint Library. 


Please realize that creating Flows in Power Automate is done on a site/library basis, so you may need to have multiple copies for multiple libraries. There may also be rate limits and activation caps to consider given larger volumes. PowerAutomate does not scan for updates immediately, so there may be a few minute delay between the trigger from LegalServer and the action from PowerAutomate. 


Creating Subfolders via Power Automate

For example, a Power Automate Flow could be set up to automatically create subfolders for a case once the initial case folder has been created by LegalServer.

The above example creates a subfolder named "documents" in any folder created at the root level of the SharePoint Library named "RTFtoDOC". It only happens at that level and not to subfolders. The Create new folder action could be repeated for additional folders as well.


Converting to DOCX via Power Automate

Another (and unfortunately more complex) option is converting a file to Docx via Power Automate. Due to the nature of the files, you cannot automatically go from RTF to DOCX directly, even with Microsoft's tools. Microsoft does allow you to convert from RTF to DOC. Once in a DOC file, there is an option to convert to DOCX from within Word Online. The following Flow would convert the file to the same name, save it in the same directory, and then delete the RTF file. That last step may be useful if you are only getting RTF files from LegalServer Templates. If you are getting RTF files elsewhere, you may want to add additional Condition steps or remove it completely. DO NOT IMPLEMENT THIS LAST STEP IF YOU DO NOT WANT TO DELETE FILES.

On the first step, you can narrow the Flow's focus to just RTF files by using the menu to open the settings for the step. Then under Trigger Conditions add: 

@endsWith(triggerOutputs()?['body/{FilenameWithExtension}'],'rtf')


Once you have the new DOC file, opening it will give you the option to convert to DOCX in Word Online. Converting to DOCX will then leave you with two copies of the file. If you don't want to have that interim DOC file (and are not concerned about other DOC files being converted to DOCX that did not start as LegalServer Templates), you can add a second flow to remove the interim DOC file.

Note that the first step would have a Trigger Condition like above but specifying "docx" instead of "rtf". Then the second step uses dynamic content from the first step, while the third step uses dynamic content from the second (and not from the first).


Again, these Flows may delete the original versions of your documents. If that is a concern, DO NOT IMPLEMENT THEM. Consider additional Conditions or limits on them. Perhaps they only run in certain subfolders or there is a way to mark a file to prevent removal. 



Automating Folder Movement to a Different Library

Many organizations have asked about automatically moving a folder from one library to another when a case is closed or a case is transferred to a different office or program. This is possible with a combination of Guided Navigation, Document Templates, and PowerAutomate. 


Step 1: The Document Template

Create a Document Template on your named something like "Move SharePoint Folder to Library A.rtf". The actually text of this document template can be as sparse as the word "Placeholder" with no actually fields to map. In LegalServer, make sure it is marked as a New Style Template but don't bother editing the fields since there are none. It should be set to automatically download (not Begin Process), and it should not be saved as a MS-Docx file. 


Step 2: Guided Navigation

Create a Guided Navigation Interactive Dialogue. This is going to have two segments. The first segment will use the Action: Generate a document to generate the template that was just created. The option to "Show link to document after it is generated" seems to be required in this instance, however if you say to run "When segment is submitted", the link won't actually show. The example below also includes a note for the end user explaining what is going on. 

The second segment switches the SharePoint Site and Library lookup from the current location to the destination library. This cannot be on the same segment, otherwise the library gets switched before the file is created and then the document template doesn't find the SharePoint folder so it is created in LegalServer instead.

Obviously, this Guided Navigation could be enhanced with logic expressions to determine which are the potential destination options. This then has to be added to an Aux Form on a matter to be activated and run. It could be a standalone Aux process or it could be included as part of your closing process. 



Step 3: PowerAutomate

In PowerAutomate, you'll need to create a new Flow. A different flow needs to be created in each Library for each potential transfer destination. 

This condition is testing for the "Name" to contain the name of the Document template. It cannot be set to equal that Document Template name since generating the document will typically include pre-appending the date as well. The second condition is to have the "File name with extension" end with "RTF". 


Then when the Condition is True, you can put the steps to move the folder and delete the Document Template.

The three steps above are to use the "Folder Path" from the "When an Item is Created" step to "Get Folder Metadata using the Path". Once you've gotten the metadata, the Document Template can be deleted to keep things clean. When setting that step, you want to use the Identifier dynamic expression from the "When an Item is Created". Deleting the document template is totally optional. The last step is to "Move Folder". Here you'll use the "ID" dynamic expression from the "Get Folder Metadata using the Path" step to identify the Folder to Move. The Destination Site Address is a dynamic dropdown and you can select the subsite needed. For the Destination Folder, use a slash followed by the name of the destination library. You may be able to browse for the library using the folder icon.


Note that this will only work if the columns in the two libraries match. If one library has additional metadata columns, the move will not work. 


Now that everything is set up, once you run through the Guided Navigation dialogue the folder move will happen. This setup will need to happen for each source/desination library.


Other Integrations

Lastly, some LegalServer consultants have tied in the use of LegalServer APIs to pull additional case related metadata into SharePoint. 


Frequently Asked Questions



Non-Standard Configurations

EPONA 1 Library per Case Setup

Working with EPONA as outside consultants, we are able to configure separate libraries for each case. LegalServer does not create the libraries in this instance, that is all done externally. This configuration is not standard, so if you are interested in this, please contact Sales for pricing. 


EPONA 1 Library per Outreach Setup

In addition to having 1 Library per case, with EPONA, we are also able to setup 1 Library per Outreach. LegalServer does not create the libraries in this instance, that is all done externally. Again, this is a non-standard setup, and contact Sales if you are interested. Creating folders in a given Library for Outreaches is on our roadmap but is not yet available.