> ## Documentation Index
> Fetch the complete documentation index at: https://help.statisfy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Drive Integration

> Connect Google Drive to Statisfy and index Drive files or folders into Knowledge Base datasets, either globally or per account.

### Connect Google Drive with Statisfy

The Google Drive integration lets you index files and folders from your organization's Google Drive into Statisfy Knowledge Base datasets. Once connected, you can attach a Drive source to any KB dataset — either as a set of global URLs that apply to the whole dataset, or as an account-level custom field whose value carries each account's own Drive URL.

**Prerequisites:**

* **Admin access** to Statisfy (the integration is org-scoped — one connection serves the whole tenant)
* A Google account that has access to the Drive files and folders you want to index
* The Drive files or folders shared with that account (org-wide visibility also works)

### What Gets Indexed

| File Type              | How it's Read    |
| ---------------------- | ---------------- |
| Google Docs            | Exported as HTML |
| PDF                    | Direct download  |
| Word (`.docx`, `.doc`) | Direct download  |
| Plain text (`.txt`)    | Direct download  |
| Markdown (`.md`)       | Direct download  |
| HTML                   | Direct download  |

Other file types — including Google Sheets, Google Slides, shortcuts, Forms, Maps, and Sites — are not indexed. If you have a spreadsheet or presentation you want indexed, export it as a PDF and add the PDF to your Drive instead.

### Steps to Connect

1. **Log in to Statisfy.**

2. Navigate to **Integrations → Admin Apps → Google Drive → Connect**.

3. A Google sign-in popup will open. Sign in with the account that has access to the Drive content you want to index, and approve the requested scopes (read-only access to Drive files plus your email address).

4. Once consent completes, Google Drive will appear as **Connected** on the Integrations page.

<Note>
  The connected account's Drive permissions determine what Statisfy can read. If a file isn't shared with that account, Statisfy can't index it. We recommend connecting with an account that already has broad access to the content you plan to index (for example, a workspace-wide shared drive owner), or sharing each file/folder explicitly with the connected account.
</Note>

### Add a Google Drive Source to a KB Dataset

After Google Drive is connected, you can attach Drive content to any Knowledge Base dataset. The Drive source is added from the **Configure Dataset** dialog, which is only available after the dataset exists.

1. Open **Knowledge Base** and create the dataset if it doesn't exist yet.

2. Open the dataset, then click the **settings (gear)** icon in the top-right of the dataset page to open the **Configure Dataset** dialog.

3. Under **Connected Source**, select **Add Source → Google Drive**.

4. Choose how the URLs should be applied:
   * **URL mode** — paste one or more Drive URLs that apply to the whole dataset.
   * **Custom field mode** — pick an account-level custom field; Statisfy will read each account's Drive URL from that field and index it scoped to that account.

5. Click **Save Changes**. Statisfy starts the initial sync immediately.

<Note>
  **Recursive folder indexing is not supported.** When you provide a folder URL, Statisfy indexes only the supported files directly inside that folder — subfolders and their contents are ignored. If you need content from nested folders, paste each folder's URL explicitly (or flatten the layout in Drive).
</Note>

### Supported URL Formats

Both folder and individual file URLs work. Paste them as you'd copy them from your browser:

| Resource     | URL Pattern                                    |
| ------------ | ---------------------------------------------- |
| Folder       | `https://drive.google.com/drive/folders/{id}`  |
| File (Drive) | `https://drive.google.com/file/d/{id}/view`    |
| Google Doc   | `https://docs.google.com/document/d/{id}/edit` |

Query strings (e.g. `?usp=sharing`) are accepted — Statisfy extracts the resource ID and ignores the rest.

### Global vs Per-Account Mode

**Global mode (URLs)** — One or more URLs apply to the whole dataset. Use this for content that's relevant across all accounts: product documentation, internal wiki exports, playbooks.

**Per-account mode (custom field)** — Statisfy iterates over every account that has a non-empty value for the chosen custom field, treats each value as a Drive URL, and indexes the contents scoped to that account. Use this when each account has its own folder of materials — onboarding decks, executive business reviews, contract folders.

A single Drive source uses **either** URLs **or** a custom field — not both. Choose the mode that matches the data layout.

### Troubleshooting

<Accordion title="Google Drive card stays disabled or shows 'Not connected' in the KB dataset dialog">
  * Confirm an admin has completed the OAuth connection at **Integrations → Admin Apps → Google Drive**.
  * If you just connected and the dialog still shows disconnected, close and reopen the dataset dialog to refresh the connection status.
</Accordion>

<Accordion title="Sync runs but a specific file isn't indexed">
  * **Check the file type.** Forms, Maps, Sites, shortcuts, and unsupported MIME types are skipped by design.
  * **Check the file size.** Files larger than 10 MB are skipped — split the file or export a smaller version.
  * **Check sharing.** The connected Google account must have at least viewer access to the file.
</Accordion>

<Accordion title="OAuth consent screen says 'Access blocked' or 'redirect_uri_mismatch'">
  * This is a configuration issue on Statisfy's side, not something you can fix as an admin. Contact [support@statisfy.com](mailto:support@statisfy.com) with a screenshot of the error.
</Accordion>

### Need Help?

For setup help, source configuration, or troubleshooting indexed content, contact [support@statisfy.com](mailto:support@statisfy.com).
