Microsoft SharePoint Excel icon

Microsoft SharePoint Excel

Read and write Excel files in SharePoint (bypasses WAC token issues).

Sheet → Upsert Rows

AI-generated

Summary

Updates rows in a SharePoint-hosted Excel worksheet that match a key column value, and appends rows that don't match. It downloads the .xlsx via Microsoft Graph, edits it locally with ExcelJS, then uploads the whole file back.

Inputs

  • Site (required) — SharePoint site, chosen from a searchable list or entered by ID (e.g. contoso.sharepoint.com,site-guid,web-guid).
  • Drive (required) — Document library/drive containing the file, from a list or by ID.
  • File (required) — The .xlsx file, picked from a list or entered by item ID. The list only shows .xlsx files in the drive root.
  • Sheet (required) — Worksheet to upsert into, from a list or by name. It must exist or the operation errors.
  • Data Mode — How row data is supplied. Auto-Map (default) uses each input item's JSON. Map Each Column Below uses the column mapper. Raw uses a JSON object or array.
  • Columns (required) — Manual mode only. Maps values to the sheet's header columns. At least one matching column must be selected, and it acts as the key. The mapper allows only one match column.
  • Row Data (required) — Raw mode only. A JSON object, or an array of objects for multiple rows. Keys are column headers.
  • Key Column (required) — Auto-Map and Raw modes only. Header name used to match existing rows. It must exist in the header row.
  • Options > Header Row — 1-indexed row containing the headers. Defaults to 1. Matching starts from the row below it.

Output shape

A single item summarizing the run: { success: true, rowsUpdated, rowsAppended, sheet }.

The output contains counts only, not the written rows. Input items are processed together and produce one output item. Only keys matching existing header names are written, and other keys are silently ignored. Matching compares the key values as strings. Each input row must have a non-null key value or the operation throws an error. Existing rows are indexed once before processing, so duplicate keys within the same input that don't yet exist each get appended as separate rows. If several existing rows share a key, the last one is updated. A locked file (open in Excel) gives a specific error. With Continue On Fail, the output is { error } instead.

Examples

Example 1: Sync CRM contacts into a SharePoint sheet keyed by Email

Data Mode: Auto-Map; Key Column: Email; select Site, Drive, File and Sheet. Input items carry JSON fields named like the sheet headers.

Example 2: Upsert a single fixed record from raw JSON

Data Mode: Raw; Row Data: {"ID":"1001","Status":"Done"}; Key Column: ID.

Example 3: Sheet whose headers are on row 3

Data Mode: Auto-Map; Key Column: SKU; Options > Header Row: 3.

Links

Discussion