> AI agents: this is one page from Mammoth Analytics documentation. The index of all pages as Markdown is https://mammoth.io/docs/llms.txt. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get Markdown.

# Import files from OneDrive into Mammoth

> Connect Mammoth to Microsoft OneDrive with Azure app credentials and a user ID, import a file as a dataset, and export a View back to OneDrive.

The OneDrive connector imports files from **Microsoft OneDrive** into Mammoth as datasets, and you can also export a View's results back to OneDrive. It signs in with Azure app credentials (Tenant ID, Client ID, Client Secret) tied to one user's drive, not a per-user sign-in. Open it from **Data Library** > **New dataset** > **Connectors** and search for **OneDrive**. Project Admins create the connection; Project Editors can start datasets from a connection the project already has. Which connectors you can add depends on your plan.

![OneDrive dialog showing No connections and a New Connection button](https://mammoth.io/docs/images/20260826_100120_onedrive-noconnectionsscreen.webp)



## What you can bring in from OneDrive

Files in the connected user's own OneDrive, starting at the root, of these types: `.txt`, `.csv`, `.tsv`, `.psv`, `.xls`, `.xlsx`, `.xlsm`, `.xml`, `.json`, `.jsonl`, `.ndjson`, `.zip`, `.bz2`, `.gz`, `.tar`, `.7z`.

Files only shared with that user don't appear.

## Before you connect OneDrive

You need an **Azure Active Directory app** with Microsoft Graph access to the OneDrive account. A Microsoft 365 admin usually does this once. You also need the **email address / User Principal Name** of the OneDrive account Mammoth should read. You enter it as **User ID**.

### Register the Azure AD app for OneDrive

1. Go to [Azure Portal](https://portal.azure.com) → **Azure Active Directory → App registrations**.
2. Click **New registration**, name it (for example `Mammoth OneDrive`), and click **Register**.
3. Copy the **Application (client) ID**. This is your **Client ID**.
4. Copy the **Directory (tenant) ID**. This is your **Tenant ID**.
5. Go to **Certificates & secrets → New client secret**, add a description, set an expiry, and click **Add**.
6. Copy the secret **Value** at once; it won't be shown again. This is your **Client Secret**.
7. Go to **API permissions → Add a permission → Microsoft Graph → Application permissions**.
8. Add the Files application permission that covers the target user's drive.
9. Click **Grant admin consent**.

## Connect OneDrive to Mammoth

These steps follow the shared flow in [Connect a database or app](https://mammoth.io/docs/learn/get-data-in/connect-a-source/).

1. Go to the **Data Library** and click **New dataset**.
2. Choose **Connectors**.
3. Search for **OneDrive** and click its tile. The connector workspace opens with the **Chat** showing.
4. In the **Chat**, Mammoth shows a card that asks for the connection details. Fill in all four fields below.
5. Click **Connect**. There's no sign-in step, because the connector uses the app credentials. If the check fails, the card shows the error.

![OneDrive New Connection form with User ID, Tenant ID, Client ID, and Client Secret fields](https://mammoth.io/docs/images/20260826_100206_onedrive-newconnectrion.webp)



| Field | What to enter | Example |
| --- | --- | --- |
| **User ID (Email / User Principal Name)** | The OneDrive account Mammoth should read | `user@yourorg.onmicrosoft.com` |
| **Tenant ID** | Azure AD Directory (tenant) ID | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` |
| **Client ID** | Azure AD Application (client) ID | `yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy` |
| **Client Secret** | The app secret value you created | |

## Open a OneDrive file and pick columns

1. In **Tables**, browse the folders and click a file to see its rows. A spreadsheet opens to its tabs.
2. Tick the columns you want. They gather in **Your table**.
3. Click **Preview 100 rows** to check the result.

If a file can't open in the panel yet, ask the agent in the **Chat** to import it.

## Save a OneDrive file as a dataset

1. Click **Save as dataset**.
2. Enter a **Dataset name** and choose a folder under **Save in**.
3. Click **Save**. When the dataset is ready, click **Open dataset**.

## Bring in new OneDrive files on a schedule

Mammoth saves a file from this connector once and shows **Saved once. Scheduled refresh for files is coming.** A [Dataset Refresh](https://mammoth.io/docs/learn/automate/refresh-a-dataset/) automation can't re-read it. To bring in new files as they arrive:

1. Set up a **File Collection** automation that collects them into a folder. See [What you can automate](https://mammoth.io/docs/learn/automate/).
2. Set up a [Data Consolidation](https://mammoth.io/docs/learn/automate/consolidate/) automation that adds that folder's files to a dataset.

## Export a View to OneDrive

Separately from importing, you can send a View's output to OneDrive:

1. In the data editor, click **Export**, choose **External Destinations**, and select **Export to OneDrive**.
2. Fill in **Tenant ID**, **Client ID**, **Client Secret** and **User ID**.
3. Set a **Folder Path** (the default is the root of the user's OneDrive) and a **File Name**.
4. Optionally turn on **Include hidden columns**.

See [Send data to a database or BI tool](https://mammoth.io/docs/learn/share-and-export/send-to-destinations/) for other export destinations.

## Troubleshoot OneDrive connections

| Symptom | Likely cause | Fix |
| --- | --- | --- |
| Authentication fails | A value is copied wrong, or consent is missing | Check **User ID**, **Tenant ID**, **Client ID** and **Client Secret**, and confirm admin consent for the Graph permission |
| "OneDrive not found for the specified user" | The **User ID** doesn't match a mailbox or drive in the tenant | Check the email or UPN for typos |
| Authentication stops working later | The client secret expired | Generate a new secret in Azure Portal and update the connection in Mammoth |
| A file doesn't appear | Unsupported type, or the file is only shared with the user | Use a supported type, and keep the file in the user's own OneDrive |

## Related

- [SharePoint](https://mammoth.io/docs/learn/get-data-in/connectors/sharepoint/): import files from a site's document library.
- [Connect a database or app](https://mammoth.io/docs/learn/get-data-in/connect-a-source/): the shared connector workspace steps.
- [Manage saved connections](https://mammoth.io/docs/learn/get-data-in/connections/): update the connection when a secret expires.
- [Combine incoming data](https://mammoth.io/docs/learn/automate/consolidate/): add collected files to one dataset.
- [Send data to a database or BI tool](https://mammoth.io/docs/learn/share-and-export/send-to-destinations/): other places to export a View.

---
Source: https://mammoth.io/docs/learn/get-data-in/connectors/onedrive.md · Updated: 2026-11-08
