Google Drive Search Integration
Purpose: Show a read-only list of Google Shared Drive files on a case profile. LegalServer searches one Google Shared Drive (formerly called a Team Drive) for files whose name or contents mention the case number or the client's name.
Cost: $2,200.00 one time setup fee for the Google Search Integration. TBD for the new Google Folder Integration.
Status: Generally available. This is LegalServer's original Google Drive integration. For new implementations, LegalServer generally recommends the Google Drive Folder Integration. See Choosing a Google Drive Integration for help deciding.
How it works
The Search Integration adds a Google Team Drive Documents list view that you can place on a case profile. Each time someone opens that profile, LegalServer asks Google Drive for every file in the configured Shared Drive that matches the case.
By default, a file matches when its file name or document text contains any of the following:
- The LegalServer case number (for example,
24-0001234). - The client's full name.
- The client's first name and last name, anywhere in the file.
First Last(for example,Maria Lopez).Last, First(for example,Lopez, Maria).
You can restrict matching to the case number only. See Exact Case Number Matching.
What the Search Integration does not do:
- It does not create folders in Google Drive.
- It does not upload, rename, move, or delete files.
- It does not save LegalServer documents, notes, emails, or generated templates to Google Drive.
- It does not create a permanent link between a file and a case. Results are recalculated from Google's search each time the list loads.
Because results come from a search, you may see files that mention a client with a similar name (false positives), and you may miss files that do not contain the case number or client name (false negatives).
Before You Begin
You need:
- A Google Workspace account with access to the Google Cloud Console.
- A Google Shared Drive that holds your case documents.
- A Google Workspace administrator who can create a project, enable an API, and create a service account.
- A LegalServer user who can configure list views and profiles.
- LegalServer staff to enable the feature on your site. Contact LegalServer Support to request it.
Google Workspace Setup
These steps create the credentials LegalServer uses to search your Shared Drive. If your organization has not used the Google Cloud Console before, a Google Workspace administrator may need to enable it first.
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 Drive with the service account.
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 Shared 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 the Shared Drive With the Service Account
- Open the JSON file and copy the
client_emailvalue. It looks similar tolegalserver-drive@your-project.iam.gserviceaccount.com. - In Google Drive, open your Shared Drive, and then click Manage members.
- Add the service account email as a member.
The Search Integration only reads file information, so the Viewer role is enough. Share only the Shared Drive you want LegalServer to search.
Important: The list is built using the service account's access, not the access of the person viewing the case. Any LegalServer user who can see the list view can see the names, locations, and dates of matching files, even if they do not have access to that Shared Drive in Google.
LegalServer Configuration
Step 1: Find Your Shared Drive ID
Open the Shared Drive in your browser. The Shared Drive ID is the last part of the URL. For example, in this URL:
https://drive.google.com/drive/u/0/folders/0ABcDeFgHiJkLmNoPQR
The Shared Drive ID is 0ABcDeFgHiJkLmNoPQR .
Step 2: Add the List View to a Case Profile
- Edit the case profile (or profile view) where the list should appear.
- Add a list view element and choose Google Team Drive Documents.
- Open the list view's configuration.
Step 3: Enter the Configuration

Fill in the configuration form using your Shared Drive ID and the values from the JSON key file:
| Configuration field | Where to find it |
|---|---|
| Team Drive ID | The Shared Drive ID from Step 1. |
| OAuth Client ID | Leave blank. This field is not used. |
| OAuth Client Secret | Leave blank. This field is not used. |
| Type | type in the JSON file. 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 . Defaults to Google's standard value. |
| Token URI | token_uri . Defaults to Google's standard value. |
| Auth Provider X509 Cert URL | auth_provider_x509_cert_url |
| Client X509 Cert URL | client_x509_cert_url |
Formatting the Private Key
In the JSON file, the private key is one long line that contains \n characters where line breaks belong. The key in LegalServer must have a real line break at the end of each line:
-----BEGIN PRIVATE KEY----- MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC... ... -----END PRIVATE KEY-----
To format the key:
- Copy the
private_keyvalue without the surrounding quotation marks. - Paste it into the Private Key field.
- Replace each
\nwith a line break. - Keep the
-----BEGIN PRIVATE KEY-----and-----END PRIVATE KEY-----lines. - Expand the field and check that each line ends with a line break and that no lines, including the header and footer, run together.
LegalServer also converts any remaining \n characters into line breaks when it reads the key. If you see an authentication error, re-paste the key and check its formatting first.
Exact Case Number Matching
By default, the list includes files that match either the case number or the client's name. To show only files that contain the case number, check All results must contain an exact match to the LegalServer case number of this case.
Use this option when your staff consistently include the case number in file names, or when client-name matching returns too many unrelated files.
Step 4: Add Instructions for Staff (Optional)

Consider adding an Instruction element above the list view so staff know what they are looking at. You can paste this into the Instruction:
<img width="39" alt="Google Drive icon" src="https://upload.wikimedia.org/wikipedia/commons/thumb/1/12/Google_Drive_icon_%282020%29.svg/128px-Google_Drive_icon_%282020%29.svg.png"> <b>Google Shared Drive Documents</b><br> (Below are Shared Drive documents created on or after the date this case began that contain this client's first and last name OR this case number in the document text or title.)
If you turn on exact case number matching, change the description so it only mentions the case number.
Using the List
The list view shows these columns:
| Column | Description |
|---|---|
| Location | The Shared Drive name and folder path of the file. |
| Document Name | The file name. Click it to open the file in Google Drive. |
| Created | The date the file was created in Google Drive. |
| Modified | The date the file was last modified in Google Drive. |
Users can filter the list by Document Name, Created, and Modified.
The Created filter starts at the earliest of the case's date opened, interview date, or intake date. Files created before that date are hidden until a user clears or changes the filter. This reduces results for clients with common names, but it also hides older files about the same person.
Clicking a file opens it in Google Drive. Google checks the user's own Google account at that point, so the user needs permission to the file in Google Drive to open it.
If Google returns an error, the list shows Google Team Drive Error: followed by Google's message in place of results.
Testing
- Add a document to your Shared Drive whose file name contains a test client's first and last name or a case number.
- Open that case in LegalServer and check the list.
Put the name or case number in the file name for the fastest results. Google can take some time to index a file's contents, so files that only mention the client in the document text may not appear right away.
Limitations and Considerations
- One Shared Drive per list view. Each list view searches a single Shared Drive. It does not search My Drive or other Shared Drives.
- Credentials are stored on the list view. If you place the list view on more than one profile, you must enter the credentials in each list view. When you rotate the service account key, update every list view.
- Search quality depends on Google. Results depend on Google's indexing. New files, scanned images, and files without searchable text may not appear.
- Folders can appear in results. Folders whose names match the case number or client name are listed with other results.
- Common names can cause false positives. Use exact case number matching or the Created filter to narrow results.
- Performance. The list asks Google for results each time the profile loads. Large Shared Drives or broad matches can make profiles load more slowly. Very large result sets may not be returned in full.
- Not compatible with the Folder Integration. If the Google Drive Folder Integration is turned on for your site, the Google Team Drive Documents list view stops returning results. Plan to replace the list view with the Google Drive Tree View block if you move to the Folder Integration.
Frequently Asked Questions
Can I connect to multiple Shared Drives?
This has not been fully tested. Each list view searches one Shared Drive. Placing two Google Team Drive Documents list views on the same profile or profile view may not work because of credential caching.
Using different Shared Drives on different profile views should work. For example, your Main Profile could search one Shared Drive while a "DV Case Profile" searches another. Large or multiple searches may run into Google's rate limits.
LegalServer welcomes feedback on what works, or doesn't, if you try this.
Why don't I see a file I know is about this client?
Check the following:
- The file is in the Shared Drive configured on the list view.
- The file name or text contains the case number or the client's name in one of the supported formats.
- The file was created on or after the start of the Created filter.
- Google has had time to index the file's contents.
- Exact case number matching is not hiding name-only matches.
Why do I see files that are not about this client?
Name matching can find other people with the same name. Turn on exact case number matching, or ask staff to include the case number in file names.
Can staff upload files to Google Drive from the list?
No. The Search Integration is read-only. If you want to upload documents from LegalServer, see the Google Drive Folder Integration.
Does the OAuth Client ID field let users sign in with Google?
No. The OAuth fields on the list view configuration are not used. The list always searches using the service account.