Sharepoint Block
Read and create pages
The Sharepoint block integrates Microsoft SharePoint into your workflows so you can manage pages and discover sites using OAuth authentication. Use it to read existing pages, create new pages, or list the SharePoint sites available to your account.
Overview
| Property | Value |
|---|---|
| Type | sharepoint |
| Category | tools |
| Color | #E0E0E0 |
When to Use
- Create a new SharePoint page with custom content from upstream workflow data
- Read the contents of an existing page by name or page ID
- List all SharePoint sites accessible to the connected Microsoft account
- Publish AI-generated summaries or reports directly to a SharePoint site
- Pull page content into a workflow for downstream processing or analysis
- Discover site IDs to wire into other SharePoint operations
Configuration
Operation
Dropdown (dropdown) that selects what the block does. Required. Options:
| Label | ID |
|---|---|
| Create Page | create_page |
| Read Page | read_page |
| List Sites | list_sites |
The remaining fields show or hide based on this choice.
Microsoft Account
OAuth credential (oauth-input) for connecting your Microsoft account. Required scopes include openid, profile, email, Files.Read, Files.ReadWrite, and offline_access. Shown for all operations.
Select Site (siteSelector)
File selector (file-selector) for choosing the target SharePoint site from a visual picker (mode: basic). Available for all three operations. When set, its value takes precedence over the manual Site ID field. If not set the tools fall back to the root site.
- Condition: shown when
operationiscreate_page,read_page, orlist_sites
Page Name (pageName)
Short text input for the page name. Used when creating or looking up a page by name (an alternative to using the Page ID on Read Page). Both .aspx and bare names are accepted on reads.
- Condition: shown when
operationiscreate_pageorread_page
Page ID (pageId)
Advanced short text input that identifies a page by its Microsoft Graph page ID instead of its name. Takes precedence over Page Name when both are supplied.
- Condition: shown when
operationisread_page(advanced mode)
Page Content (pageContent)
Long text input holding the body content of the page to create. Rendered as a single-column article layout in SharePoint.
- Condition: shown when
operationiscreate_page
Site ID (manualSiteId)
Advanced short text input to enter a SharePoint site ID manually. Leave empty to target the root site. Ignored when siteSelector is set.
- Condition: shown when
operationiscreate_page(advanced mode)
Inputs & Outputs
Inputs (all sub-block ids that can be wired from other blocks):
operation(string) — Operation to perform (create_page,read_page, orlist_sites)credential(string) — Microsoft account OAuth credential (access token)pageName(string) — Page name (create or read by name)pageContent(string) — Page content (create only)pageTitle(string) — Page title; defaults to page name when omitted (create only)pageId(string) — Page ID (read by ID, advanced)siteSelector(string) — Site selector from the visual file pickermanualSiteId(string) — Manual site ID; overridden by siteSelector when both are setpageSize(number) — Results per page for list operations
Outputs (vary by operation):
sites(json) — Array of SharePoint site objects, each containingid,name,displayName,webUrl,description,createdDateTime, andlastModifiedDateTime. Returned by List Sites when the search returns multiple results.site(json) — Single SharePoint site object with the same fields plusisPersonalSite,root, andsiteCollection. Returned by List Sites when targeting a specific site by ID or group.page(json) — SharePoint page object withid,name,title,webUrl,pageLayout,createdDateTime, andlastModifiedDateTime. Returned by Create Page and Read Page (single-page result).content(json) — Page content object withcontent(extracted plain text) andcanvasLayout(raw Microsoft Graph canvas structure). Returned by Read Page for a single page.pages(json) — Array of{ page, content }objects. Returned by Read Page when listing all pages on a site (nopageIdorpageNamesupplied).totalPages(number) — Total count of pages returned when listing all pages.
Tools
- Create SharePoint Page (
sharepoint_create_page) — POSTs a new article-layout page tohttps://graph.microsoft.com/v1.0/sites/{siteId}/pagesvia the Microsoft Graph API. AcceptspageName(required), optionalpageTitle, and optionalpageContent(wrapped in a one-column canvas section). Returns the created page metadata. - Read SharePoint Page (
sharepoint_read_page) — GETs one or more pages from a SharePoint site. WhenpageIdis supplied it fetches that specific page with canvas content expanded. WhenpageNameis supplied it filters by name and fetches content for the first match. When neither is supplied it lists up topageSizepages (default 10, max 50) and fetches content for each. Returnspage/contentfor a single result orpages/totalPagesfor a list. - List SharePoint Sites (
sharepoint_list_sites) — GETs SharePoint sites via the Microsoft Graph API. Without asiteSelectororgroupIdit searches all accessible sites (?search=*). With a site ID or group ID it returns that specific site's details. Returnssites(array) orsite(object) accordingly.
YAML Example
sharepoint_1:
type: sharepoint
name: "Sharepoint"
inputs:
operation: "create_page"
credential: "{{credentials.sharepoint}}"
siteSelector: "{{start.siteId}}"
pageName: "Weekly Report"
pageContent: "{{agent_1.content}}"
connections:
outgoing:
- target: next-block-id