Google Drive Folder Integration
Purpose: Create one Google Drive folder for each case, link that folder to the case in LegalServer, and let staff work with the folder's files from the case profile. Optionally, LegalServer can save case documents, note attachments, generated templates, and case emails directly into the case's Google Drive folder.
Cost: TBD. Contact LegalServer for pricing.
Status: Beta. This is LegalServer's newer Google Drive integration and the recommended option for new implementations. See Choosing a Google Drive Integration to compare it with the Google Shared Drive Search Integration.
How It Works
The Folder Integration has three main parts, plus two optional features:
| Part | What it Does |
|---|---|
| Google Drive Integration Settings | An Admin page that stores your Google credentials and default folder. |
| Google Drive - Create Case Folder block | Creates the case's Google Drive folder, or links an existing folder. |
| Google Drive - Tree View block | Shows the case folder's files and subfolders on the case. |
| Google user sign-in (optional) | Lets staff upload files as themselves instead of as the service account. |
| Store Documents in Google Drive (optional) | Saves new case documents in Google Drive instead of LegalServer. |
The key idea is that LegalServer stores the folder's unique Google ID, not its name or location. After a case is linked to a folder, you can rename or move the folder in Google Drive and the case stays connected to it.
Before You Begin
You need:
- A Google Workspace account with access to the Google Cloud Console.
- One or more Google Shared Drives where case folders will live.
- A Google Workspace administrator who can create a project, enable an API, create a service account, and (optionally) create an OAuth client.
- A LegalServer user with permission to edit document settings, lookups, and dynamic forms or processes.
- LegalServer staff to enable the feature on your site. Contact LegalServer Support to request it.
Google Workspace Setup
These steps create the service account that LegalServer uses to create folders and work with files. A service account is required even if you also turn on Google user sign-in.
Overview of Setup Steps
- Create a project in your organization's Google Cloud Console.
- Enable the Google Drive API for that project.
- Create a service account and download its JSON key file.
- Share your Shared Drives or parent folders with the service account.
- (Optional) Create an OAuth client for Google user sign-in.
Step 1: Create a Project
- Go to the Google Cloud Console API dashboard.
- If you have no projects yet, click Create Project. If you already have projects, click the project selector next to the search bar, and then click New Project.
- Enter a project name, such as
LegalServer Google Drive, and then click Create. - Wait for the notification in the upper right to say the project is complete. Click the notification to open the new project's dashboard.
Step 2: Enable the Google Drive API
- Open the navigation menu (three stacked lines) in the upper left, and then click APIs & Services.
- Click Enable APIs and Services.
- Search for
google drive, click Google Drive API, and then click Enable.
Step 3: Create a Service Account and Key
- Go to APIs & Services > Credentials.
- Click Create Credentials, and then choose Service Account.
- Enter a name for the service account, and then click Continue.
- Select the Service Account Token Creator role.
- Click Done. You do not need to grant users access to the service account.
- Click the new service account's name to open its details.
- Open the Keys tab, click Add Key, and then click Create New Key.
- Choose JSON as the key type. Google downloads a
.jsonfile.
Store the JSON file securely. It contains a private key that lets anyone who has it access everything the service account can access. Do not email it or save it in a shared folder.
Step 4: Share Drives or Folders With the Service Account
- Open the JSON file and copy the
client_emailvalue. It looks similar tolegalserver-drive@your-project.iam.gserviceaccount.com. - Add the service account as a member of each Shared Drive that will hold case folders. You can also share only the specific parent folders where LegalServer will create case folders.
The service account creates folders, uploads files, renames files, moves files, and moves files to the trash. Give it a role that allows all of these actions in your Shared Drive, such as Content manager. A role that only allows adding files (such as Contributor) may cause move and delete actions to fail.
Important: LegalServer performs Google Drive actions using the service account's access, not the access of the person using LegalServer (unless Google user sign-in is used for uploads). A LegalServer user who can see a case's Tree View can see and change files in that case's folder, even if they have no access to it in Google. Share only the Shared Drives or folders LegalServer needs, and use LegalServer permissions and profile design to control who sees the Tree View.
Step 5 (Optional): Create an OAuth Client for Google User Sign-In
Skip this step if you only want LegalServer to use the service account. See Google User Sign-In (OAuth) to decide whether you need it.
- In the same Google Cloud project, configure the OAuth consent screen (in newer versions of the console, this is under Google Auth Platform). For a Google Workspace organization, choose the Internal audience so only your organization's accounts can sign in.
- Add the Google Drive scope,
https://www.googleapis.com/auth/drive. - Go to APIs & Services > Credentials, click Create Credentials, and then choose OAuth client ID.
- Choose Web application as the application type.
- Under Authorized redirect URIs, add your LegalServer site address followed by
/user/google. For example:
https://yourorg.legalserver.org/user/google
If staff use more than one address for your site, add a redirect URI for each address.
- Click Create, and then copy the Client ID and Client Secret.
LegalServer Configuration
Step 1: Enter the Google Drive Integration Settings
Go to Admin > Document > Google Drive Integration Settings. You need the permission to edit document settings to open this page.
Copy each value from the JSON key file into the matching field:
| Setting | JSON Field or Value |
|---|---|
| Type | type . Usually service_account |
| Project ID | project_id |
| Private Key ID | private_key_id |
| Private Key | private_key (see below) |
| Client ID | client_id |
| Client Email | client_email |
| Auth URI | auth_uri |
| Token URI | token_uri |
| Auth Provider X509 Cert URL | auth_provider_x509_cert_url |
| Client X509 Cert URL | client_x509_cert_url |
| OAuth Client ID | Optional. From Step 5 of the Google setup. |
| Default Google Drive Initial Folder | The ID of the default parent folder for case folders. |
All of the service account fields are required. If any are blank, LegalServer cannot connect to Google Drive.
The page also includes a Use Service Account for Google Drive checkbox. This setting does not currently change how the integration works. The service account is always used unless Google user sign-in is turned on for a specific block.
Security note: The Private Key is displayed as plain text on this page. Limit who has permission to edit document settings.
Formatting the Private Key
The private key formatting here is different from the Search Integration. LegalServer does not convert \n characters on this page. Replace every \n in the JSON value with a real line break so the key looks like this:
-----BEGIN PRIVATE KEY----- MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC... (each line is 64 characters long) ... -----END PRIVATE KEY-----
Each line except the last line of the key, the header, and the footer should be 64 characters long. Do not include the surrounding quotation marks from the JSON file.
Finding a Folder ID
When you open a folder in Google Drive, the folder ID is the last part of the URL. For example, in this URL:
https://drive.google.com/drive/u/0/folders/10YxIjpT_kOWsevodUByKZFXOQtipjhQ9
The folder ID is 10YxIjpT_kOWsevodUByKZFXOQtipjhQ9 .
Step 2: Set Up Google Drive Initial Folders
An initial folder is a parent folder where LegalServer creates case folders. Go to Admin > Lookups > Google Drive Initial Folders and add a value for each parent folder:
| Field | Value |
|---|---|
| Name | Any name staff will recognize, such as Housing Unit or 2026 Cases . |
| Folder Id | The Google folder ID of the parent folder. |
Add your default initial folder to this lookup too. The Create Case Folder block requires you to choose a value from this lookup.
You can use more than one initial folder to group case folders by office, program, year, or another feature. Different initial folders can be in different Shared Drives.
Plan for growth: Google limits a Shared Drive to 400,000 items, including files and folders. This is a hard cap. Create initial folders in more than one Shared Drive so you can spread cases out as you grow, for example by year.
Step 3: Add the Create Case Folder Block
Add the Google Drive - Create Case Folder block to an intake process or an auxiliary process.
The block cannot be on the first page of an intake because the case must exist before LegalServer can create its folder. Place it on a later page, or in an auxiliary process staff run from an existing case.
Block settings:
| Setting | Description |
|---|---|
| Google Drive Initial Folder | . The parent folder where new case folders are created. |
| Allow manual folder selection | Lets staff link the case to an existing folder by pasting its link or ID. |
| Store Response in a Case Note? | Adds a case note with the result from Google. Turned on by default. |
Each copy of the block can use a different initial folder. For example, an intake process for one office can create folders in that office's Shared Drive.
Step 4: Add the Tree View Block
Add the Google Drive - Tree View block to a case profile or form where staff should see the folder. The only setting is Use Google OAuth User Authentication. See Google User Sign-In (OAuth).
Creating Case Folders
What Staff See

When staff submit a form with the Create Case Folder block:
- If the case has no folder: The block does not display anything. When the form is submitted, LegalServer queues the folder to be created in the background.
- If the case already has a folder: The block shows
Case folder already exists in Google Drive.and a link to open the folder. LegalServer does not create a second folder.

Folder creation happens in the background, so the folder may take a moment to appear. A successful form submission means the request was queued, not that Google has finished creating the folder.
Folder Names
New folders are named with the client's name and the case number:
Last, First (26-0000034)
The name includes the client's suffix and middle name when they are entered, for example Lopez Jr., Maria Elena (26-0000034) . For cases with an organization as the client, the organization name is used instead.
You can rename or move the folder in Google Drive without breaking the link.
Linking an Existing Folder Manually
If Allow manual folder selection is turned on, staff see a Manually specify Google Drive folder option. If the case already has a folder, the option is labeled Manually specify a different Google Drive folder.
When staff choose Yes, they can paste either a Google Drive folder link or a folder ID into Google Drive Folder Link or ID. LegalServer accepts links such as:
https://drive.google.com/drive/folders/10YxIjpT_kOWsevodUByKZFXOQtipjhQ9 https://drive.google.com/drive/u/0/folders/10YxIjpT_kOWsevodUByKZFXOQtipjhQ9
When a folder is linked manually:
- LegalServer links the case to that folder and does not create a new one.
- If the case was already linked, the new folder replaces the old link. The old folder is not changed or deleted in Google Drive.
- If Store Response in a Case Note? is on, LegalServer adds a case note that records the folder ID, and the previous folder ID when it is replaced.
LegalServer checks that the value looks like a folder link or ID. It does not check that the folder exists or that the service account can reach it. Make sure the folder is in a Shared Drive or folder shared with the service account.
Case Notes
When Store Response in a Case Note? is on, LegalServer adds a Google Drive Note with the subject Google Drive API Response :
- On success, the note includes the new folder's ID, name, and parent folder.
- On failure, the note starts with
ERRORand includes Google's error code and message.
These notes are the best place to start troubleshooting when a folder does not appear.
Folder Information in Reports and the API
Each case stores these Google Drive fields, which can be used in reports:
- Google Drive Folder ID
- Google Drive Folder Link
- Google Drive Case Folder Creation Enqueue Time: When the folder request was queued.
- Google Drive Case Folder Creation Time: When the folder was created or first linked.
- Google Drive Folder ID Manually Set: Whether staff linked the folder manually.
Organizations using the LegalServer Core API can also:
- Create a case's Google Drive folder. You can choose an initial folder from the Google Drive Initial Folders lookup, or use the default initial folder. If the case already has a folder, the existing folder is returned. This requires the API Matter Google Drive: Create Folder permission.
- Read a case's Google Drive Folder ID and Folder Link, search cases by folder ID, and set the folder ID when creating or updating a case.
See the Core API documentation for details.
Using the Tree View

The Tree View shows the case folder and everything inside it. The case folder is expanded, and subfolders are collapsed. Click the arrow next to a subfolder to expand it.

If the case does not have a folder yet, the block shows no files. If the linked folder cannot be found, the block shows Folder not found .
| Action | How |
|---|---|
| Open a file or folder | Click its blue name. It opens in Google Drive in a new tab. |
| Upload files | Click Upload Files, or drag files from your computer onto the tree. |
| Rename a file | Click the pencil icon. |
| Delete a file | Click the trash icon. The file moves to Google Drive's trash. |
| Move a file | Drag the file onto another folder in the tree. |
Things to know:
- Uploads go to the top-level case folder. To put a file in a subfolder, upload it, and then drag it into the subfolder.
- Upload size limit. Each file can be up to 100 MiB.
- Folders cannot be moved, renamed, or deleted from the Tree View. Manage subfolders in Google Drive.
- Subfolders must be created in Google Drive. The Tree View does not have a New Folder action.
- Files uploaded through the Tree View are stored only in Google Drive. They are not saved as LegalServer documents and do not appear in the case's LegalServer document list.
- Opening files uses the user's Google access. Clicking a file opens it in Google Drive, where Google checks the user's own account. Staff need access to the Shared Drive in Google to open files.
- Changes made in Google Drive appear the next time the Tree View loads.
Google User Sign-In (OAuth)
By default, every Google Drive action LegalServer takes is performed by the service account. In Google Drive, uploaded files show the service account as the uploader.
With Google user sign-in, staff connect their own Google account to LegalServer. Files they upload are then created by their Google account, so Google Drive shows who uploaded each file, and Google checks that the user is allowed to add files to that folder.
What Google User Sign-In Covers
Google user sign-in currently applies to uploads from two places:
- Files uploaded or dropped into a Google Drive - Tree View block that has Use Google OAuth User Authentication turned on.
- Case note attachments uploaded through a New Note block that has Use OAuth For Google Drive Authentication turned on. This block setting only appears when Store Documents in Google Drive is turned on for your site.
These actions still use the service account, even when Google user sign-in is turned on:
- Displaying the folder and its contents in the Tree View.
- Renaming, moving, and deleting files in the Tree View.
- Creating case folders.
- Saving documents from the Add Document form, document templates, emails, and Add to Google Drive.
- Downloading note attachments through LegalServer.
Because of this, the service account settings are still required, and the service account still needs access to your Shared Drives.
Turning On Google User Sign-In
- Complete Step 5: Create an OAuth Client.
- Enter the OAuth Client ID and OAuth Client Secret on the Google Drive Integration Settings page.
- Edit each Tree View block that should use it, and turn on Use Google OAuth User Authentication.
- If you store documents in Google Drive, edit each New Note block that should use it, and turn on Use OAuth For Google Drive Authentication.
If either OAuth setting is blank, the block setting has no effect and the block uses the service account.
What Staff See When Signing In
When a staff member who has not connected their Google account opens a Tree View that uses Google user sign-in, the block shows:
Could not authenticate, please click here to authorize LegalServer for Google Drive
In a New Note form, the file upload area shows a Click here to log in to Google Drive link instead.
After clicking the link, the user signs in to Google, approves access to Google Drive, and returns to the page they were on.
How Long a Connection Lasts
The Google connection is kept only for the current LegalServer session and for the life of Google's access token, which is usually about one hour. LegalServer does not currently refresh the token automatically. Staff can expect to authorize again after their Google token expires or after they log in to LegalServer again.
Users need permission in Google Drive to add files to the case folder, such as the Contributor role or higher on the Shared Drive.
Store Documents in Google Drive
LegalServer can save new case documents directly into the case's Google Drive folder instead of storing them in LegalServer. This is an optional setting that LegalServer staff turn on. Contact LegalServer Support to request it.
Review before turning this on: Documents saved this way are stored in Google Drive, not in LegalServer. Review your backup, retention, access, audit, and download requirements before turning this on.
Requirements
- The Folder Integration is set up, including the service account settings.
- LegalServer staff have turned on Store Documents in Google Drive for your site.
- SharePoint and Dropbox document storage are not turned on. If either is turned on, it is used instead of Google Drive.
- The case already has a Google Drive folder. LegalServer does not create the folder automatically when a document is saved.
This setting applies only to documents on cases. Documents on other records, such as outreach or projects, are still stored in LegalServer.
What Gets Saved to Google Drive
| Where the document comes from | What happens |
|---|---|
| Add Document form | New uploads are saved to the top level of the case folder. |
| Case note attachments | Attachments are saved to the top level of the case folder and listed on the note. |
| Document templates | Generated documents are saved to the case folder. |
| Emails sent to the case | The email is saved as an .eml file in an emails subfolder. |
| Email attachments | Attachments are saved in an emails/attachments subfolder. |
| Add to Google Drive action | A copy of an existing LegalServer document is saved to the case folder. |
Add Document Form
New files uploaded through the Add Document form are sent to the case's Google Drive folder. They are not saved as LegalServer documents and do not appear in the case's LegalServer document list. Documents that were already stored in LegalServer stay in LegalServer.
If the case does not have a folder yet, the form shows:
The case folder does not exist in Google Drive. Please create the case folder in Google Drive.
Case Note Attachments
Files attached to a case note are saved to the case folder. The note is still saved in LegalServer and lists the files under Google Drive Documents Attached. Each file has:
- A link to open the file in Google Drive. This uses the user's Google access.
- A Download link that retrieves the file through LegalServer.
If the case does not have a folder yet, the note form shows a message instead of the file upload field.
Document Templates
When Store Documents in Google Drive is on, the submit button on template forms for cases reads Click Here To Generate The Document And Upload To Google Drive. LegalServer generates the document, saves it to the case folder, and removes the temporary LegalServer copy. For templates saved as Word documents, the browser then downloads the new file from Google Drive.
HotDocs templates are not saved to Google Drive.
If the case does not have a folder, document generation fails with a Google Drive folder not found error.
Emails Sent to the Case
When an email is sent to a case's email address:
- The email is saved as an
.emlfile in anemailssubfolder of the case folder. LegalServer creates the subfolder if needed. - Attachments are scanned for viruses and saved in an
emails/attachmentssubfolder. - File names start with the date and time the email was processed, followed by the subject, for example
2026-11-09 14.03.22.123456 - Lease notice.eml. - The email note is still created in LegalServer. If the email cannot be saved to Google Drive, the note starts with
Email was unable to be saved to Google Drive.
Add to Google Drive
When Store Documents in Google Drive is on, the case's document list includes an Add to Google Drive action (a Google Drive icon in the classic document list). It copies an existing LegalServer document into the top level of the case folder. The original document stays in LegalServer.
Troubleshooting
| Problem | What to Check |
|---|---|
| No folder is created | Check the case notes for a Google Drive API Response note with an error. Confirm the initial folder is shared with the service account. |
Could not authenticate, please contact your system administrator |
One or more service account settings are blank or incorrect. Check the Private Key formatting first. |
Folder not found in the Tree View |
The linked folder was deleted, or the service account can no longer reach it. |
| Staff cannot open files from the Tree View | The user's own Google account does not have access to the Shared Drive. |
| Rename, move, or delete fails | The service account's role on the Shared Drive does not allow that action. |
The case folder does not exist in Google Drive |
Run the Create Case Folder block for the case, or link a folder manually. |
| Staff are asked to authorize Google repeatedly | This is expected with Google user sign-in. The connection lasts for about an hour and for the current LegalServer session. |
| The Google Team Drive Documents list view is empty | The Search Integration list view stops working when the Folder Integration is turned on. Use the Tree View instead. |
Limitations and Considerations
- One folder per case. Each case links to one folder. The folder can contain any number of subfolders.
- Shared Drive size limit. A Shared Drive can hold up to 400,000 items. Spread case folders across Shared Drives using multiple initial folders.
- Service account access. The service account can see and change everything shared with it. Anyone who can use the Tree View on a case can act on that case's files through the service account.
- Large folders. The Tree View checks each subfolder for contents when it loads, so folders with many subfolders can load slowly. Very large folders may not show every item.
- Files in more than one folder. Google Drive shortcuts and files with more than one parent folder are not fully supported.
- Not compatible with the Search Integration. Turning on the Folder Integration stops the Google Team Drive Documents list view from returning results.
- Classic display. The Create Case Folder and Tree View blocks currently display in the classic LegalServer layout.
Frequently Asked Questions
Can I connect to multiple Shared Drives?
Yes. Each case connects to one folder, but different cases can use folders in different Shared Drives. Add an initial folder for each Shared Drive to the Google Drive Initial Folders lookup and choose the right one on each Create Case Folder block. For example, you can use one Shared Drive for 2025 cases and another for 2026 cases. The service account must be a member of every Shared Drive.
Can I rename the case's Google Drive folder?
Yes. LegalServer stores the folder's Google ID, so renaming it does not break the link.
Can I move the case's Google Drive folder?
Yes. Moving the folder does not break the link. If you run the Create Case Folder block again, it still recognizes the case as having a folder and does not create a new one.
Can I change which folder a case is linked to?
Yes, if Allow manual folder selection is turned on for a Create Case Folder block. Choose Manually specify a different Google Drive folder and paste the new folder's link or ID. The old folder is not changed in Google Drive.
What happens to files if I delete them from the Tree View?
They move to Google Drive's trash. A Google Drive or Shared Drive manager can restore them from the trash.
Are files in Google Drive backed up by LegalServer?
No. Files uploaded through the Tree View, and documents saved with Store Documents in Google Drive, are stored in Google Drive. Your organization's Google Workspace retention and backup policies apply to them.
Will Google show who uploaded a file?
Only for uploads that use Google user sign-in. Other actions are performed by the service account and are shown that way in Google Drive. LegalServer case notes and logs show the LegalServer user for actions recorded in LegalServer.