GuideOpen

SharePoint Connector Actions - Reference

Read this file whenever editing a SharePoint action (sharedsharepointonline). SharePoint operations have unique complexities: OData query parameters with $-prefixed names, dynamic output schemas, and strict quoting rules that differ from other connectors.

SharePoint Connector Actions — Reference

Read this file whenever editing a SharePoint action (shared_sharepointonline). SharePoint operations have unique complexities: OData query parameters with $-prefixed names, dynamic output schemas, and strict quoting rules that differ from other connectors.

Critical: $-Prefixed Property Names in TaskDialog YAML

SharePoint operations like GetItems, GetFileItems, and PostItem use OData parameters: $filter, $orderby, $top. In a TaskDialog action YAML, these must be wrapped in both double and single quotes:

# CORRECT — double-quoted string containing single quotes
- kind: ManualTaskInput
  propertyName: "'$filter'"
  value: "Status eq 'Active'"

- kind: AutomaticTaskInput
  propertyName: "'$orderby'"
  description: The OData orderBy clause (e.g. Created desc, Title asc)

- kind: ManualTaskInput
  propertyName: "'$top'"
  value: "50"
# WRONG — these will all fail at runtime
- kind: ManualTaskInput
  propertyName: $filter          # ❌ bare $-prefixed key — YAML may misparse
  propertyName: "$filter"        # ❌ only double quotes — runtime won't match
  propertyName: '$filter'        # ❌ only single quotes — runtime won't match
  propertyName: filter           # ❌ missing $ prefix entirely
Why "'$filter'"? The Copilot Studio runtime expects the property name to be the literal string '$filter' (with single quotes included). The outer double quotes are YAML string delimiters; the inner single quotes are part of the value sent to the connector.

InvokeConnectorAction (inline in topics) — Different Format

When calling SharePoint inline in a topic (not a standalone TaskDialog), use the parameters/ prefix instead:

- kind: InvokeConnectorAction
  operationId: GetItems
  input:
    parameters/dataset: https://contoso.sharepoint.com/sites/HR
    parameters/table: Events
    parameters/$filter: "Status eq 'Active'"

Do NOT mix these two formats. "'$filter'" is for TaskDialog inputs; parameters/$filter is for InvokeConnectorAction.

OData Filter Syntax

The $filter value uses OData v4 syntax — not SQL, JavaScript, or Power Fx.

Operators

OperatorMeaningExample
eqEqualStatus eq 'Active'
neNot equalStatus ne 'Closed'
gtGreater thanPriority gt 3
ltLess thanPriority lt 5
geGreater or equalDueDate ge '2026-01-01T00:00:00Z'
leLess or equalDueDate le '2026-12-31T23:59:59Z'
andLogical ANDStatus eq 'Active' and Priority gt 3
orLogical ORStatus eq 'Active' or Status eq 'Pending'
notLogical NOTnot(Status eq 'Closed')

String Functions

FunctionExample
startswith(field,'value')startswith(Title,'Project')
substringof('value',field)substringof('urgent',Title)

Quoting Rules

  • String values must be in single quotes: Title eq 'My Document'
  • Numbers have no quotes: Priority gt 3
  • Dates use ISO 8601 in single quotes: Created ge '2026-01-01T00:00:00Z'
  • Boolean uses no quotes: IsActive eq true
  • Column names (internal names, not display names) have no quotes: Status eq 'Active'

Common Wrong vs. Right

WrongRightIssue
Status == 'Active'Status eq 'Active'== is not OData
Status eq "Active"Status eq 'Active'OData uses single quotes for strings
Status eq ActiveStatus eq 'Active'String values must be quoted
Status != 'Closed'Status ne 'Closed'!= is not OData
Priority > 3 && Status eq 'Active'Priority gt 3 and Status eq 'Active'> and && are not OData
Created >= '2026-01-01'Created ge '2026-01-01T00:00:00Z'Use full ISO 8601 datetime
Display Name eq 'foo'InternalName eq 'foo'Use internal column names, not display names

Input Recommendations for SharePoint Operations

GetItems / GetFileItems

ParameterRecommended Input KindWhy
dataset (Site Address)ManualTaskInputFixed at design time — the orchestrator will hallucinate URLs if set to Automatic
table (List/Library Name)ManualTaskInputFixed at design time — the orchestrator cannot discover list names
"'$filter'"ManualTaskInput if the filter is always the same; AutomaticTaskInput if it depends on conversation contextIf Automatic, provide a very precise description with the exact column names and allowed values
"'$orderby'"ManualTaskInputUsually fixed (e.g., Created desc)
"'$top'"ManualTaskInputUsually a fixed limit (e.g., "10")

Example — GetItems with a fixed list and dynamic filter:

inputs:
  - kind: ManualTaskInput
    propertyName: dataset
    value: "https://contoso.sharepoint.com/sites/HR"

  - kind: ManualTaskInput
    propertyName: table
    value: "Employees"

  - kind: AutomaticTaskInput
    propertyName: "'$filter'"
    description: |-
      OData filter for the Employees SharePoint list.
      Available columns: Title (text), Department (text), Status (choice: Active, Inactive, OnLeave), HireDate (datetime).
      Use OData syntax: eq, ne, gt, lt, ge, le, and, or. String values in single quotes.
      Examples: "Department eq 'Engineering'", "Status eq 'Active' and HireDate ge '2025-01-01T00:00:00Z'"
    entity: StringPrebuiltEntity
    shouldPromptUser: true

  - kind: ManualTaskInput
    propertyName: "'$top'"
    value: "50"

PostItem (Create item) / PatchItem (Update item)

ParameterRecommended Input KindWhy
datasetManualTaskInputFixed site URL
tableManualTaskInputFixed list name
itemAutomaticTaskInputThe item body — describe the exact column names and types in the description

Dynamic Outputs Warning

SharePoint's GetItems and GetFileItems have outputType: UnresolvedDynamicType — the output columns depend on the specific list/library schema. The AI cannot know the column names. When editing an action that outputs list data:

  1. Ask the user for the column names they need from the list
  2. Only reference columns the user has confirmed
  3. Warn the user to verify column internal names in SharePoint (Site Settings → List Settings → Column names)

Internal names differ from display names (e.g., display name "Employee Name" → internal name "EmployeeName" or "Employee_x0020_Name" for names with spaces).

Discovering List Columns Before Writing Filters

The AI cannot guess the column names, types, or internal names of a SharePoint list. Before building a $filter or configuring inputs/outputs, always ask the user to share their list's actual columns.

The most reliable way is to ask the user to:

  1. Run a GetItems call (via the Copilot Studio test chat or the SharePoint connector action) with no filter and $top set to 1
  2. Share the JSON response — it reveals the exact internal column names, types, and sample values

Use the response to:

  • Write accurate $filter expressions using the real internal column names
  • Populate AutomaticTaskInput descriptions with the exact column names and allowed values
  • Configure outputs with the correct propertyName values
Why this matters: Column display names like "Assigned To" often have internal names like AssignedTo or Assigned_x0020_To. Choice columns have specific allowed values. Without seeing real data, the AI will guess wrong.

Person/Group Column Filtering

SharePoint Person/Group columns (e.g., "Assigned To", "Created By", "Manager") require special handling. You cannot filter them by DisplayName — you must filter by the EMail sub-property.

Syntax

AssignedTo/EMail eq '[email removed]'

Not AssignedTo eq 'John Doe' — this will return zero results.

Common Wrong vs. Right (Person/Group)

WrongRightIssue
AssignedTo eq 'John Doe'AssignedTo/EMail eq '[email removed]'Must use /EMail sub-property
AssignedTo/DisplayName eq 'John Doe'AssignedTo/EMail eq '[email removed]'DisplayName is not filterable in SharePoint REST
Author eq 'Jane Smith'Author/EMail eq '[email removed]'"Created By" internal name is Author
Editor eq 'Jane Smith'Editor/EMail eq '[email removed]'"Modified By" internal name is Editor

Two-Step Pattern: Resolve User Email First

When the user says "filter by assigned to me" or "show items for John", the agent needs the email address — not a display name. Use the Office 365 Users connector (shared_office365users) to resolve the email first, then pass it to the SharePoint filter.

Step 1 — Get the user's email (in a topic, before calling the SharePoint action):

# Get current user's profile
- kind: InvokeConnectorAction
  id: getProfile_abc123
  connectionReference: shared_office365users
  connectionProperties:
    mode: Invoker
  operationId: UserGet_V2
  output:
    kind: SingleVariableOutputBinding
    variable: init:Topic.UserProfile

# Extract the email
- kind: SetVariable
  id: setEmail_def456
  variable: Topic.UserEmail
  value: =Topic.UserProfile.mail

Step 2 — Use the email in the SharePoint filter:

For a TaskDialog action with AutomaticTaskInput, include the email as part of the description:

- kind: AutomaticTaskInput
  propertyName: "'$filter'"
  description: |-
    OData filter for the Tasks SharePoint list.
    To filter by person, use: AssignedTo/EMail eq '{email}'.
    The user's email is available in the conversation context.
    Column reference: Title (text), Status (choice: Not Started, In Progress, Completed), AssignedTo (person), DueDate (datetime).
  entity: StringPrebuiltEntity
  shouldPromptUser: true

For an InvokeConnectorAction inline in a topic, interpolate the email directly:

- kind: InvokeConnectorAction
  id: getMyTasks_ghi789
  connectionReference: shared_sharepointonline
  connectionProperties:
    mode: Invoker
  operationId: GetItems
  input:
    parameters/dataset: https://contoso.sharepoint.com/sites/Projects
    parameters/table: Tasks
    parameters/$filter: ="AssignedTo/EMail eq '" & Topic.UserEmail & "'"
  output:
    kind: SingleVariableOutputBinding
    variable: init:Topic.MyTasks

Other Filterable Person Sub-Properties

Sub-propertyFilterableNotes
EMailYesAlways use this — most reliable
IdYesSharePoint user ID (integer) — stable but not human-readable
DisplayNameNoNot filterable in SharePoint REST/OData
TitleNoSame as DisplayName — not filterable

Source: https://github.com/microsoft/skills-for-copilot-studio/blob/main/skills/edit-action/sharepoint-actions.md

Author: microsoft, Copilot Studio skills (Microsoft). License: MIT.

Shown here with formatting for the web; email addresses removed. Keep the author and license notice when you reuse it.

Related entries

There are more like this in the members library

The Microsoft Copilot library holds 1,122 entries. Members can search all of them by meaning and read every one in full.