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

# SharePoint as a data source

> Bring data from SharePoint to Nekt.

SharePoint is Microsoft's collaboration and document management platform. This allows you to access and process spreadsheet, CSV, or raw unstructured files that are stored in a secure, collaborative environment with version control and access management.

<img height="50" src="https://mintcdn.com/nekt/3MFKt2g7jzqFpztO/assets/logo/logo-sharepointexcel.png?fit=max&auto=format&n=3MFKt2g7jzqFpztO&q=85&s=346dbba0650457e35f1c633c0cb7a49d" data-path="assets/logo/logo-sharepointexcel.png" />

## Configuring SharePoint as a Source

In the [Sources](https://app.nekt.ai/sources) tab, click on the "Add source" button located on the top right of your screen. Then, select the Sharepoint option from the list of connectors.

Click **Next** and you'll be prompted to add your access.

### 1. Add account access

1. First, authorize Nekt by clicking the **Microsoft Authorization** button.
2. Next, select the folder where your files are located.

If you are extracting raw files instead of tabular data, configure the following setting:

* **Attachments Volume**: Select the Nekt volume where the fetched files will be uploaded. This is required when the connector mode is set to **Unstructured**.

Click **Next**.

### 2. Select streams

In the discovery process, the connector lists all files available in the selected folder.

* **For structured data**: The connector maps each CSV or .XLSX file along with its header columns to a distinct data stream. It's important to ensure these files are properly formatted in a tabular way to make sure data can be mapped properly to a table in your Lakehouse.
* **For unstructured data**: The connector lists a single stream called `sharepoint_files` that will replicate the raw files to your configured Nekt volume and create a metadata table.

After the files are mapped, you can select the ones you want to extract.

> Tip: You can easily find a column by typing its name.

Click **Next**.

<Note>
  In case new files are added to the folder, you should click on 'Add streams' in the source details page to discover, configure and include them in the extraction process.
</Note>

### 3. Configure data streams

Customize how you want your data to appear in your catalog. Select a name for each table (which will contain the fetched data) and the type of sync.

* **Table name**: we suggest a name, but feel free to customize it. You have the option to add a **prefix** and make this process faster!

* **Sync Type**: only full table mode is available for this connector, meaning every time the extraction happens, we'll get the current state of the data and save it in overwrite mode.

#### Multi-file extraction (Structured Data)

If your SharePoint folder contains multiple files with the same format (e.g. daily reports), you can merge them into a single stream and process them incrementally. This is useful when new files are added regularly and you don't want to re-process everything on every run.

**How it works**

Under **Advanced Settings**, configure the following fields:

| Setting              | Description                                                                                                        | Example                |
| -------------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------- |
| **File name filter** | Wildcard pattern to match files by name. `*` matches any characters, `?` matches a single character.               | `report_*.xlsx`        |
| **Start date**       | Only process files modified on or after this date (ISO 8601). Used as the cutoff for the first extraction.         | `2026-01-01T00:00:00Z` |
| **Stream name**      | Custom name for the merged stream. If not set, a name is derived from the filter pattern.                          | `daily_reports`        |
| **Primary keys**     | List of column names that uniquely identify each record. Used by the destination to correctly merge (upsert) data. | `["order_id"]`         |

When a **File name filter** is set:

1. The connector lists all files in the folder that match the pattern.
2. All matching files are merged into a **single stream** instead of one stream per file.
3. Two metadata columns are added to each record:
   * `source_file`: the name of the file the record came from.
   * `source_file_modified_at`: the file's last modification timestamp, used as the incremental bookmark.
4. On subsequent runs, only files modified after the last extraction are processed.

<Warning>
  **Defining primary keys is strongly recommended.** The destination uses primary keys to merge (upsert) records into your table. Without them, a generated `row_id` based on file name and row position is used as a fallback, which can cause duplicates or missed updates if rows are inserted or reordered between files. Choose columns that uniquely identify each record across all files (e.g. `order_id`, or a combination like `order_id` + `order_date`).
</Warning>

<Note>
  All files matching the pattern must share the same schema (same columns and data types). The schema is inferred from the first matching file.
</Note>

Once you are done configuring, click **Next**.

### 4. Configure data source

Describe your data source for easy identification within your organization, not exceeding 140 characters.

To define your [Trigger](https://docs.nekt.com/runs/scheduling-and-triggers), consider how often you want data to be extracted from this source. This decision usually depends on how frequently you need the new table data updated (every day, once a week, or only at specific times).

Once you are ready, click **Next** to finalize the setup.

### 5. Check your new source

You can view your new source on the [Sources](https://app.nekt.ai/sources) page. If needed, manually trigger the source extraction by clicking on the arrow button. Once executed, your data will appear in your Catalog.

<Warning>For you to be able to see it on your [Catalog](https://app.nekt.ai/catalog), you need at least one successful source run.</Warning>

> If you encounter any issues, reach out to us, and we'll gladly assist you!

# Streams and Fields

Depending on your extraction mode, SharePoint exposes different streams:

* **Structured Mode**: The connector dynamically generates streams based on the CSV and Excel files found in your folder. The schema of each stream reflects the columns inside that specific file.
* **Unstructured Mode**: The connector provides a single stream containing metadata for the files it uploads to your Nekt volume.

<AccordionGroup>
  <Accordion title="SharePoint Files (sharepoint_files)">
    Stream emitted in unstructured mode. Iterates over the files discovered in the configured folder, uploads them to a Nekt volume, and emits one metadata record per file. Downstream targets will materialize a single `sharepoint_files` table.

    **Key fields:**

    | Field            | Type     | Description                                    |
    | :--------------- | :------- | :--------------------------------------------- |
    | `drive_id`       | String   | SharePoint drive ID.                           |
    | `item_id`        | String   | SharePoint drive-item ID.                      |
    | `file_name`      | String   | File name in SharePoint.                       |
    | `file_size`      | Integer  | File size in SharePoint, in bytes.             |
    | `mime_type`      | String   | MIME type reported by SharePoint.              |
    | `sharepoint_url` | String   | Web URL of the file.                           |
    | `etag`           | String   | SharePoint eTag of the file.                   |
    | `created_at`     | DateTime | When the file was created in SharePoint.       |
    | `modified_at`    | DateTime | When the file was last modified in SharePoint. |

    *Note: This stream also includes standard volume attachment metadata properties generated by the Nekt SDK.*
  </Accordion>
</AccordionGroup>

## Implementation Notes

### Performance & File Processing

* **Excel Extraction:** To guarantee optimal performance and prevent slow processing times, the connector reads entire Excel (`.xlsx`) sheets into memory at once. Once loaded, the data is broken down and yielded in memory-friendly chunks for downstream processing.
* **Empty Columns:** During extraction, any completely empty columns in the spreadsheet are automatically identified and excluded before syncing the data.

## Skills for agents

<Snippet file="agent-skills-intro.mdx" />

<Card title="Download SharePoint skills file" icon="wand-magic-sparkles" href="/sources/sharepoint.md">
  SharePoint connector documentation as plain markdown, for use in AI agent contexts.
</Card>
