Site Selected SharePoint — Custom n8n Node
The Site Selected SharePoint node reads and writes SharePoint list items, files, and lists via Microsoft Graph under BC Gov's Sites.Selected app-only permission model. It eliminates the nine-node HTTP/Code chain previously required for SharePoint operations in CCP workflows.
It supports four resources:
- Item — CRUD operations on SharePoint list items with automatic column name resolution
- File — Download, upload (simple + chunked), and update file content/metadata
- List — Retrieve list metadata and enumerate site lists
- User — Resolve emails to SharePoint lookup IDs and enumerate site users
Overview
| Property | Value |
|---|---|
| Node name | siteSelectedSharepoint |
| Display name | Site Selected SharePoint |
| Style | Programmatic (execute() method) |
| Version | 1 |
| Credential | siteSelectedSharepointOAuth2Api (extends n8n OAuth2 API) |
| Category | Transform |
| AI-tool capable | Yes (usableAsTool: true) |
| Resources | Item, File, List, User |
Documentation Index
| Document | Description |
|---|---|
| Node Operations | Detailed guide to every resource, operation, and parameter |
| Credentials | Azure AD setup, credential fields, and troubleshooting |
Source Files
community-nodes/
├── credentials/
│ └── SiteSelectedSharepointOAuth2Api.credentials.ts # OAuth2 credential definition
├── nodes/
│ └── SiteSelectedSharepoint/
│ ├── SiteSelectedSharepoint.node.ts # Main node + execute dispatcher
│ ├── actions/
│ │ ├── file/ # Download, Upload, Update
│ │ ├── item/ # Create, CreateOrUpdate, Delete, Get, GetMany, Update
│ │ ├── list/ # Get, GetMany
│ │ └── user/ # EnsureUser, GetByLookupId, GetLookupId, GetMany
│ ├── methods/ # loadOptions + resourceMapping
│ └── transport/ # graphRequest, resolve, cache, coerce, simplify
└── tests/
└── SiteSelectedSharepoint/ # Unit tests
Quick Start
- Configure the Site Selected SharePoint OAuth2 credential (see Credentials)
- Drag "Site Selected SharePoint" into your workflow
- Select a Resource (Item, File, List, or User)
- Select an Operation (e.g. Create, Get Many, Upload)
- Provide a Site (defaults to the credential's Default Site URL if left blank)
- For Item operations, pick a List from the dropdown or enter by name/ID
- For File operations, select a Document Library (or leave as Default)
Key Features
Automatic Column Resolution
Supply field values by display name — the node resolves internal names (e.g. OData__x0043_oors__x0023_) automatically. The renamed-Title quirk (LinkTitle → Title) is handled transparently.
Person Field Resolution
Supply an email address for Person/Group fields — the node resolves the SharePoint LookupId internally. No more manual User Information List queries.
Simplify Output
When enabled (default), Item Get/Get Many responses:
- Flatten
fieldsto the item root - Re-key internal names back to display names
- Result:
$json["COORS #"]instead of$json.fields.OData__x0043_oors__x0023_
Ensure User Fallback
If a person isn't found in the User Information List (they've never visited the site), the "Ensure User" option provisions them via SharePoint REST. Requires the Sites.Selected permission on the SharePoint resource in addition to Graph.
Chunked Upload
Files larger than 4 MB are uploaded via Graph's resumable upload session protocol. Each chunk (default 5 MiB, configurable) is independently retried on transient failures.
Resource Mapper & Dropdowns
- Item fields use the resource mapper widget — display names, types, required flags, and choice dropdowns are loaded from the list schema
- List and Document Library support a "From List" dropdown mode (resolves from the configured site)
Metadata Caching
Site IDs, list IDs, and column maps are cached in a per-credential TTL cache (default 15 minutes) to reduce Graph API calls. The same cache backs both node execution and the Site/List/"Add Column" dropdowns, so opening the column picker repeatedly doesn't re-hit Graph every time. The cache can be refreshed via the Refresh Metadata Cache toggle — checking it busts the cache for the next execution and the next dropdown open, which is useful right after adding, renaming, or removing a SharePoint column.
Retry with Backoff
All Graph requests automatically retry on HTTP 429 (throttled) and 503 (service unavailable) responses, honouring the Retry-After header when present, otherwise using exponential backoff with jitter.
Common Workflow Patterns
Create a list item with person fields
- Set Resource = Item, Operation = Create
- Select the target List
- Use "Pick Fields" mode and select the Person column
- Enter the user's email — the node resolves it to a LookupId automatically
Upsert (Create or Update) a list item
- Set Resource = Item, Operation = Create or Update
- Provide the field values (display name or internal name)
- In "Match Fields (JSON)", specify the key fields to match on, e.g.
{"Title": "Record-123"} - If a matching item exists, it's updated; otherwise a new item is created
Upload a file to a document library
- Set Resource = File, Operation = Upload
- Provide the binary input field name (default:
data) - Set the File Name and optional Folder Path
- Choose Conflict Behaviour (Fail, Replace, or Rename)
- For files > 4 MB, the chunked protocol is used automatically
Download a file
- Set Resource = File, Operation = Download
- Provide the drive-item ID (from a previous Get Many or Graph query)
- The file content is placed in the output binary field (default:
data)
Filter list items
- Set Resource = Item, Operation = Get Many
- Choose a Filter Type:
- Simple — add conditions via the UI (column, operator, value); display names are resolved automatically
- OData — enter a raw OData
$filterexpression, e.g.fields/Status eq 'Approved' and fields/Age ge 18. Reference columns by internal name under thefields/prefix; wrap text in single quotes; write dates as ISO 8601 without quotes. See Node Operations → OData Filter for details.
Resolve a person from a LookupId
Item Get/Get Many return Person columns as raw integers (e.g. RequestingOfficerLookupId: 17). To get the person's name/email:
- Set Resource = User, Operation = Get by Lookup ID
- In Lookup ID, enter the integer — a single value or comma-separated (
17,16) — e.g.={{ $json.fields.RequestingOfficerLookupId }} - The node returns
{ displayName, email, userName, lookupId, requestedLookupId }per ID
This is the reverse of User → Get Lookup ID (email → LookupId).
Known Limitations
- Chunked upload auth header — Graph's upload session URLs are pre-authenticated; the node currently sends a Bearer token on chunk PUTs which may be redundant. If you encounter 401 errors on large uploads, this is the likely cause — please report it.
- No site enumeration —
Sites.Selectedcannot list available sites. You must know your site URL upfront. $orderby— not yet exposed on Item Get Many (the underlying Graph call supports it).
Further Reading
- Microsoft Graph API — Sites — Graph site resource documentation
- Microsoft Graph API — List Items — Graph list item operations
- Sites.Selected Permission — How Sites.Selected scoping works
- Graph Upload Session — Resumable upload protocol documentation