PAD + CloudEmail & Graph APIsharepointgraph-apioauthrest

Write to SharePoint via Graph

Creates or updates SharePoint list items via the Microsoft Graph API REST endpoint. Handles OAuth2 client credentials token acquisition and automatic refresh, so the flow never fails mid-run due to an expired token. Works from both attended and unattended PAD sessions.

Members OnlySign in or create a free account to view and copy this pattern.

Usage Notes

  • Register an Azure AD app with Sites.ReadWrite.All permission and note the Tenant ID, Client ID, and Client Secret.
  • The token expires in 3600s — the pattern checks expiry and refreshes automatically before each batch of writes.
  • Replace varSiteId and varListId with your SharePoint site and list GUIDs (found in the SharePoint list settings URL).
  • For updates, set varItemId to the SharePoint list item ID and use the PATCH method instead of POST.
  • Wrap writes in the Retry with Exponential Backoff pattern — Graph API has per-minute throttle limits.

Requirements

  • Power Automate Desktop 2.30+ or Power Automate Cloud
  • Azure AD App Registration with Sites.ReadWrite.All
  • Variables: varTenantId, varClientId, varClientSecret, varSiteId, varListId (all Text)
Write to SharePoint via Graph | FlowLibs