This article was created in response to a support issue logged with K2. The content may include typographical errors and may be revised at any time without notice This article is not considered official documentation for K2 software and is provided “as is” with no warranties.

Issue

The create Document Set method of SharePoint Online Document Set SmO fails with the following error message:

"The 'parameters.LeafName' argument is invalid"

Symptoms

You are unable to use the long path and name for the Create Document Set method of SharePoint Online Document Set SmartObject with the following error message:


"The 'parameters.LeafName' argument is invalid"

This issue happens when you use Name & Path of the summary length of more than 128 characters.

Resolution

This is a limitation of the SharePoint CSOM API which K2 broker depends on. See more details here in MSDN documentation for ListItemCreationInformation.LeafName property.

Document set name cannot exceed 128 characters.

But for versions of K2 4.7 older than March 2018 CU FP1, we cannot exceed the 128 limit if we use 128 characters both for the Document Set Name (LeafName property) and the Folder (FolderUrl property). I.e. An incorrect limit is imposed on the summary length of the Document Set Name and Folder path. This issue has been addressed in the March 2018 CU FP1.

Before applying the March 2018 CU FP1 when using the Create Document Set method for SharePoint Online library you will be getting an error when the  summary length of Document Set Name and Folder (path) exceeds 128 characters whereas this 128 characters limit should be applicable only to Document Set Name.

Once you apply March 2018 CU FP1 you can see that the following issues are resolved:

You can specify a Document Set Name with 129 characters maximum. With this Name length you can also have the path length (Folder property) equal to 239 characters maximum, please see the following path as example:

Folder1/Folder2/Folder3/Folder4/Folder5/Folder6/Folder7/Folder8/Folder9/Folder10/Folder11/Folder12/Folder13/Folder14/Folder15/Folder16/

Folder17/Folder18/Folder19/Folder20/Folder21/Folder22/Folder23/Folder24/Folder25/Folder26/Folder27/Fold

If you decrease the length of the Document Set Name you can increase the path length.

So in summary you can use 368 characters for both Name and Path. If you exceed this limit you will be getting an error stating that URL path for all folders and files must be 400 characters or less.
Individual folder names also cannot exceed 129 characters.