Legalsense can create a folder in SharePoint, in your own Microsoft 365 environment, for every new matter. The folder is named after the matter, and the matter page links to it. This article explains how to connect Legalsense to SharePoint, when and how Legalsense creates and renames folders, and what to do when a folder doesn't appear.
Before you start
- You need the permission
manage_sharepoint. Permissions are granted through permission groups; see the article ↪ Permission groups. Without this permission, SharePoint doesn't appear under Settings → Integrations. Ask ↪ Legalsense Support if none of your groups has it. - An administrator of your Microsoft 365 environment gives consent in step 2.
- An account that is a SharePoint administrator and a member of the SharePoint site signs in once in step 3. One person can do both steps if they have both roles. These Microsoft accounts don't have to be the account you log in to Legalsense with.
- The SharePoint site and the document library for the matter folders already exist. Legalsense doesn't create sites or libraries.
- Do all steps in the same browser: the Microsoft login returns to the browser session of the Legalsense user who started it. If someone else logs in to Microsoft, they do so in that user's browser, for example during a screen-sharing session.
In this article
Connect Legalsense to SharePoint
Connecting takes four steps. The Status line on the page always shows which step is next.
Step 1: Open the SharePoint page
Go to Settings → Integrations → SharePoint.
The SharePoint entry in the left menu of Integrations, below Company information and AI provider.
As long as nothing is connected, Status reads Legalsense is not connected to SharePoint yet. The Application ID identifies the Legalsense application in Microsoft 365.
The SharePoint page before connecting.
Step 2: Give consent in Microsoft 365
- Click Connect to SharePoint. Legalsense sends you to Microsoft.
- Choose the Microsoft account of an administrator of your Microsoft 365 environment.
- Review the Permissions requested screen and click Accept.
Note: The consent screen lists three permissions. Have full control of all site collections can only be used on behalf of a person who is logged in: Legalsense uses it once, in step 3, while a SharePoint administrator is logged in, to give itself write access to the site you choose. It doesn't keep that login, so it can't use this permission again unless an administrator logs in again. Access selected site collections (Sites.Selected) on its own gives Legalsense no access to your SharePoint sites: Legalsense can only reach a site on which a SharePoint administrator explicitly grants it access in step 3. Sign in and read user profile is the standard permission for applications that let people log in with a Microsoft account. Microsoft also says that consent applies to all users in your organization. That's how Microsoft records consent, once for the whole organization, and it doesn't widen what Legalsense can reach. Microsoft marks the application as unverified, which means its publisher hasn't completed Microsoft's publisher verification. That label doesn't change what the application can reach once an administrator has given consent.
The Microsoft screen Permissions requested for the Legalsense application.
After you accept, Legalsense shows Legalsense is now connected to SharePoint. Select a site to continue. Under Connection, the page now also shows the Microsoft 365 tenant ID, which identifies your organization's Microsoft 365 environment, and the date and time under Consent granted. Reconnect and Disconnect replace Connect to SharePoint, and the SharePoint site section appears.
The SharePoint page after consent, with the Microsoft 365 tenant ID, the Consent granted date, the buttons Reconnect and Disconnect, and the still empty field Site URL.
Step 3: Choose the SharePoint site
- In Site URL, paste the address of the SharePoint site, for example
https://contoso.sharepoint.com/sites/legal. - Click Sign in and grant access.
- Log in to Microsoft with an account that is a SharePoint administrator and a member of this site. Microsoft shows no further permissions screen, because the administrator already accepted all permissions in step 2.
Legalsense uses this login once, to give itself write access to this site only. Write access is enough to create and rename folders, and it applies to no other site. Legalsense doesn't store the login and can't reuse it later. Microsoft shows the account picker every time, because the person who gave consent in step 2 isn't necessarily the person who may grant access to the site.
After the login, Legalsense shows Legalsense now has access to the SharePoint site, followed by the name of the site, and the Document library section appears.
The SharePoint page after the site login, with the message that Legalsense has access to the site and the new section Document library.
Step 4: Choose the document library
- Open the Document library list. It shows the document libraries of the site.
- Select the library for the matter folders.
- Click Save.
The field Document library opened, listing the libraries of the site.
Legalsense confirms with The document library was successfully saved., and Status reads The connection is working. From now on, every new matter gets a folder, directly in this library and not in a subfolder.
The SharePoint page with the message that the document library was saved and the green Status "The connection is working."
If you later enter another site, Legalsense clears the library, and you choose a library again. If you only choose another library, existing folders stay in the previous library and are never moved; only new matters get their folder in the new library.
When Legalsense creates and renames folders
Legalsense creates and renames folders in the background, so saving a matter never waits for SharePoint, even when SharePoint can't be reached.
A new matter
When you save a new matter, Legalsense queues its folder and usually creates it within seconds. It also checks for waiting folders every 2 minutes. The folder is named as described under How folder names are built below. If a folder with exactly that name already exists in the library, Legalsense uses it instead of creating a second one.
A matter page directly after saving. Matter details has no SharePoint line yet, because the folder is created a moment later.
The SharePoint document library with the new folder at the top of the list, named after the matter number, the client and the matter name.
A renamed matter
If you change the matter name or number, Legalsense renames the existing folder. It doesn't create a second folder.
Legalsense only renames folders of active matters. Archiving or deleting a matter changes nothing in SharePoint, and a matter that's renamed while archived keeps its old folder name until it's renamed again while active.
The SharePoint document library after a matter was renamed. It still holds one folder for the matter, now with the new name, and no copy under the old name. SharePoint shortens the long name in this view.
A provisional matter
A provisional matter is a draft matter without a definitive number. It shows the label Provisional and the button Finalize, and it gets no folder. Legalsense creates the folder when you click Finalize, so the folder gets the definitive number.
A provisional matter with the label Provisional, the banner Draft Matter, a temporary number and the button Finalize.
The same matter after Finalize, with the definitive number and a SharePoint line with the link Folder in Matter details.
Matters from before the connection
Legalsense only creates folders for matters created after the connection is complete. A matter that existed before then has no folder and no SharePoint line, even if you rename it. The same applies to matters created while the setup was incomplete or while Legalsense was disconnected.
The detail page of a matter from before the connection. Matter details contains no SharePoint line, which is how you recognize a matter without a folder.
How folder names are built
A folder name is the matter number, a hyphen, and the display name of the matter. By default, the display name is the client name, a slash, and the matter name. A matter with the number 20260216 for the client Thompson Inc and the matter name SharePoint test matter gets the folder 20260216 - Thompson Inc SharePoint test matter. If the display name already contains the matter number, Legalsense doesn't add it again, so a folder name doesn't always start with the number.
SharePoint doesn't accept every character in a name. Legalsense removes the characters SharePoint doesn't allow, without replacing them. This also removes the slash between the client name and the matter name, so they're separated by a single space.
For example, the matter name Merger: phase 1 * "draft" <review> | final? for the client Thompson Inc and the number 20269002 gives the folder 20269002 - Thompson Inc Merger phase 1 draft review final. The matter keeps its full name in Legalsense.
The form New matter with a matter name that contains characters SharePoint does not allow. Only the folder name is shortened by them, never the matter name.
The SharePoint link on the matter
Once the folder exists, Matter details on the matter page shows a SharePoint line with the link Folder, next to the matter's other document links. The link opens the folder in SharePoint in a new browser tab.
Legalsense doesn't give anyone access to SharePoint. A colleague who opens the link needs access to the SharePoint site already; your firm manages that access in SharePoint.
The block Matter details of a matter with the line SharePoint and the link Folder, marked with a red outline.
The matter folder opened in SharePoint in a new tab.
Disconnect and reconnect
- Under Connection, click Disconnect.
- Legalsense asks: Are you sure you want to disconnect from SharePoint? No new matter folders will be created, and existing folders are left untouched. Click Yes.
The confirmation dialog Disconnect from SharePoint with the buttons Yes and No.
Legalsense shows Legalsense is no longer connected to SharePoint. It forgets the Microsoft 365 tenant ID, the consent date, the site and the document library. No new folders are created, and matters created while Legalsense is disconnected never get one.
Existing folders stay in SharePoint with their documents, and Legalsense remembers which folder belongs to which matter. The SharePoint line does disappear from the matters.
The SharePoint page after disconnecting, in the same state as before connecting, without tenant, site or library.
The detail page of a matter that has a folder, with no SharePoint line after the disconnect.
Important: Disconnecting only ends the connection in Legalsense. The consent and the write access on the site stay in place until your Microsoft 365 administrator removes them in Microsoft 365. Legalsense has no button for this. The Application ID on the SharePoint page identifies the Legalsense application your administrator looks for.
To reconnect, repeat steps 2 to 4: give consent again, enter the site again, and choose the document library again. If you choose the same site and library as before, the links return on the matters that have folders; Legalsense doesn't create those folders again.
The SharePoint page after the new consent, with a new consent date and the empty field Site URL.
While Legalsense is connected, Reconnect repeats only the consent step, for example when Status says that Microsoft rejected the Legalsense credentials. If the consent comes from the same Microsoft 365 environment, Legalsense keeps the site and the library. If it comes from another environment, Legalsense clears them.
What Legalsense doesn't do
Legalsense doesn't synchronize documents between Legalsense and SharePoint, doesn't manage document versions, and doesn't change who has access to what in SharePoint. It creates each folder empty; everything inside it is handled in SharePoint.
Legalsense only creates and renames folders. It doesn't delete or move folders, and archiving or deleting a matter leaves its folder as it is. It creates no folders for matters that existed before the connection. One connection covers one Microsoft 365 environment, one SharePoint site and one document library.
Troubleshooting
There's no SharePoint entry under Integrations
Your user doesn't have the permission manage_sharepoint. Ask ↪ Legalsense Support if none of your permission groups has it.
The SharePoint page says the integration isn't available
If the page shows The SharePoint integration is not available on this installation. Please contact ↪ Legalsense support., contact Legalsense Support.
Consent in step 2 fails
If the administrator clicks Cancel, or Microsoft refuses the request, Legalsense shows a message that starts with Microsoft did not grant Legalsense access, followed by Microsoft's reason. Start again with Connect to SharePoint.
Choosing the site in step 3 fails
A document library is missing from the list
Legalsense remembers the list of libraries for 5 minutes, so a library created a moment ago can be missing for a few minutes. Reload the page later.
The Status line shows a problem
Legalsense tests the connection every time you open the SharePoint page. During setup, Status shows which step is next:
If Status reads The connection is not working., followed by a reason, Legalsense can't reach SharePoint. Folders wait in the queue until the connection works again, and the waiting time doesn't count as failed attempts.
A matter has no SharePoint line
- You opened the matter right after saving it. Legalsense creates the folder a moment later; reload the page.
- The matter existed before the connection, was created while Legalsense was disconnected, or is still provisional. See When Legalsense creates and renames folders above.
- Creating the folder failed. See A folder isn't created or renamed below.
The Folder link opens a page that says the folder can't be found
You probably renamed the matter a moment ago, and the link still has the old folder name. Some browsers download a file instead. Legalsense usually renames the folder within seconds; reload the matter page to get the current link.
A folder isn't created or renamed
Waiting and failed folders appear under Matter folders on the SharePoint page. This section only appears when there's something to report:
- 1 folder is waiting to be created or renamed.: the folder is in the queue, waiting for its turn or for a new attempt.
- 1 folder could not be created or renamed, even after several attempts.: Legalsense gave up. A table lists the Matter, the Error and the Last attempt. Each matter links to its matter page.
The section Matter folders with one failed folder, listing the Matter, the Error and the Last attempt, and the button Retry failed folders.
While the connection works, Legalsense tries a failed folder up to 8 times, with longer waits in between, over a little more than 4 hours. After the last attempt, it marks the folder as failed. The page lists up to 25 failed folders, most recent first.
Note: Legalsense doesn't check folder names in SharePoint. If someone renames a folder by hand in SharePoint, Legalsense doesn't notice, and the next rename of the matter overwrites that name.
To retry the failed folders once you've solved the cause:
- Click Retry failed folders.
- Legalsense asks: Are you sure you want to try again to create or rename the folders that failed? Click Yes.
The confirmation dialog Retry failed folders with the buttons Yes and No.
Legalsense shows 1 folder will be tried again shortly. and counts the folder as waiting again. It's usually created within a few seconds.
The SharePoint page after the retry, with the message "1 folder will be tried again shortly." and the line in Matter folders that one folder is waiting.
Comments
0 comments
Please sign in to leave a comment.