SharePoint / SharePoint/sp-dev-docs
CSOM has no way to create a file in a library with required metadata without filling ii tin as the UI does.
@Ashlesha-MSFT is already working on this.
Since May 5, 2026.
- 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
Issue is there in CSOM 16.1.27011.12008, but the same applies to current Power Automate actions.
Describe the bug / error
There is no way to create a file on a library (even leaving it checked out) without filling in the properties at the same time in a way that matches the UI (both modern/classic). The upload without properties will always fail with a "List data validation failed." error.
Steps to reproduce
execute something like this on a library with required metadata and no defaults:
using (MemoryStream contentStream = new())
{
// Add an empty file.
uploadFolder = destinationClientContext.Web.GetFolderByServerRelativeUrl(Path.Combine(site.AbsoluteUri,uploadFolderServerRelativeURL));
destinationClientContext.Load(uploadFolder, f => f.ServerRelativeUrl);
await destinationClientContext.ExecuteQueryAsync();
FileCreationInformation emptyFci = new()
{
ContentStream = contentStream,
Url = destinationFileName,
Overwrite = true
};
uploadFile = uploadFolder.Files.Add(emptyFci);
// push content in chunks... doesn't matter.
await destinationClientContext.ExecuteQueryAsync();
}
Expected behavior
The file should be uploaded but be checked out -- OR -- there should be a switch in the FileCreationInformation like CheckRequiredFields (as SaveBinary). The same should apply to the Power Automate actions.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.