Copilot · Community sample

Content Lens

A sample publishing assistant for SharePoint in Microsoft 365 Copilot: compare two pages side by side, check a page for harmful wording and against writing guidelines, or review the wording of comments. The sample shows how a Copilot UX component renders a live SharePoint page and marks the findings on it; accessibility, layout and freshness checks run without AI. It changes nothing in SharePoint and has a built-in fictional example.

Copilot componentReactSPFx 1.24.1
The Compare tab: two SharePoint pages side by side. The areas of the selected Copilot insight are framed in amber on both pages, with numbers in the page margins. The findings sidebar is set to Copilot insights, and the selected insight says that the two announcements give different event dates

The idea behind the sample

Content Lens is a sample publishing assistant, built as a Copilot UX component with the SharePoint Framework for people who publish SharePoint pages. A Compare tab puts two pages side by side: Copilot names where they differ in terms, dates or promises, and measured checks cover accessibility, images and links. A Page tab reads one page, published or a saved draft, with the user's own access, and asks the Microsoft 365 Copilot Chat API to check it for harmful wording and against writing guidelines that the publisher types in the component or adds from a list of common ones. The component sends the page text in numbered passages, accepts only findings that cite those passages, and shows the findings on the actual SharePoint page in the same component.

Checks that need no AI run separately: accessibility basics, layout suggestions, and dates that have passed since the page was saved. A Comments tab reviews the wording of comments beneath pages and news.

The package requests the seven delegated Microsoft Graph permissions that the Copilot Chat API requires; an administrator approves them. The Chat API is a preview API on the beta endpoint and needs the Microsoft 365 Copilot add-on license. Nothing in SharePoint is changed. A script that runs with every build checks the tool catalog, the schemas, the permission requests and the embedded agent.

Make it your own

Start with the author's setup instructions, explore the implementation, and adapt the pattern to your environment. Sample code stays in its original repository, together with its requirements, license and contribution history.

Read the source documentation

A closer look

Keep exploring

Keep the ideas flowing

Back to all possibilities
Microsoft 365 and Power Platform Community Contributor badge

Sharing is caring.

Share what you know.

Contribute a sample, improve the docs or help someone get started. Sample contributors can opt in to the PnP Recognition Program and share their community contributor badge.

Have something to show? Sign up for a community call demo. Fill in the form and we'll arrange a slot based on your availability.