SharePoint / SharePoint/sp-dev-docs

‎SharePoint Updates from Word Online not accurate

Open
#10,133 11 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

area:csom/rest/api sharepoint-developer-support type:bug-confirmed
Dominant language
PowerShell
Stars
1.4k
Forks
1.1k
Avg merge
4d 12h
Merged PRs (30d)
12

Description

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

SharePoint CSOM

Developer environment

Windows

What browser(s) / client(s) have you tested
  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)
Additional environment details

-Word Online

  • SharePoint Online CSOM Azure function
  • SharePoint Webhook
Describe the bug / error

I’m working on building a SharePoint Webhook integrated with an Azure Function that accesses a SharePoint site using an Azure Entra ID application with the Sites.Selected permission. The goal is to open a SharePoint document in Word Online, edit its content, and then use the SharePoint Webhook to trigger an Azure Function that updates the document’s metadata fields using SystemUpdate(). However, I’ve noticed an issue: if the document remains open in Word Online with AutoSave enabled, the changes made via CSOM seem to get overwritten. I’d like to understand why this is happening and how I can prevent it.

Steps to reproduce
Set Up Azure Entra ID Application:

Register an application in Azure Entra ID.

  1. Configure it with the Sites.Selected Application permission (SharePoint) and grant admin consent.
    Create an Azure Function:
  2. Develop an Azure Function (e.g., HTTP-triggered) to handle SharePoint Webhook notifications.
  3. Authenticate with SharePoint using the Azure Entra ID application using PnP command
    Configure SharePoint Webhook:
    Create a SharePoint document library in a SharePoint Online site.
    Register a Webhook subscription for the document library, pointing to the Azure Function endpoint.
    Ensure the Webhook triggers on document changes (e.g., ItemUpdated events).
    Upload a Test Document:
    Upload a Word document (e.g., TestDoc.docx) to the SharePoint document library.
    Edit Document in Word Online:
    Open TestDoc.docx in Word Online.
    Enable AutoSave (default behavior in Word Online).
    Make a content change (e.g., add a sentence) and let AutoSave sync the update.
    Trigger Metadata Update via Azure Function:
    Simulate or wait for the SharePoint Webhook to trigger the Azure Function (alternatively, manually invoke the function).
  4. Use CSOM in the Azure Function to update metadata fields of TestDoc.docx (e.g., set a custom field like Status to Updated using SystemUpdate).
  5. Confirm the metadata update reflects in SharePoint.
    Observe Conflict:
  6. While TestDoc.docx remains open in Word Online with AutoSave active, note that the metadata changes made via CSOM are overwritten or reverted after a short period.
  7. Verify this by refreshing the SharePoint library view or checking the document properties.
Expected behavior

This Happening only with fields updated via SharePoint CSOM with SystemUpdate. If we were using the Update method getting a Version Conflict issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.