Copilot / SharePoint · Community sample

SharePoint Document Submission Form

Submit files up to 50 MB and dynamic library metadata directly to a SharePoint document library from an inline Microsoft 365 Copilot chat form or a modern SharePoint page without passing file bytes through the LLM prompt.

Copilot componentWeb partReactSPFx 1.24.0-rc.0
Inline SharePoint document submission form rendered in Microsoft 365 Copilot chat with a verified Knowledge base library, staged presentation file, and required and optional metadata columns

The idea behind the sample

SharePoint Document Submission Form renders an interactive document-intake form inline in Microsoft 365 Copilot chat (via BaseCopilotComponent) and on modern SharePoint pages (via BaseClientSideWebPart). When a user asks to upload or submit a document, the declarative agent calls OpenDocumentSubmissionForm and opens the SPFx form inline.

The component verifies the target SharePoint document library (BaseTemplate 101), dynamically loads its required and optional editable columns via SharePoint REST, and uploads files up to 50 MB (direct upload up to 10 MB, chunked StartUpload/ContinueUpload/FinishUpload above 10 MB) followed by ValidateUpdateListItem under the signed-in user's delegated SharePoint permissions—without ever placing file bytes into the Copilot prompt or requesting Microsoft Graph admin consent.

Built-in security hardening locks siteUrl overrides to HTTPS on the active SharePoint Online tenant origin and enforces a strict file extension allowlist (.pdf, .docx, .xlsx, .pptx, .md, .png, .jpg).

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.