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
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.
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
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:
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.