Maximum path length for Create SharePoint Document Set is 128 characters

I have had to diagnose an issue where Create SharePoint Document Set was failing with the error message "The 'parameters.LeafName' argument is invalid."

The issue occurs when the DocumentSet Name parameter is longer than 128 characters, including any subfolder name (e.g. if you specify "myfolder/mydocumentset" then the entire string is counted in the 128 characters). Special characters that would otherwise be escaped (such as space or ampersand) are included in the count but without escaping (i.e. each special character counts as just one byte rather than the full escape sequence).

This limitation does not make any sense (there should not be a 128 character limit at all), but at the very least it should be documented that this parameter cannot exceed 128 characters, and it would be marginally better Plumsail Actions should fail gracefully with a useful message rather than simply return this nondescript error.

Hello! Thank you for reporting the issue. I have contacted developers regarding it and will post further updates in this thread.

Hello. The limitation is set by SharePoint and unfortunately, can't be eliminated on our side.

The limitation you have highlighted is the path component - as it says, the file or folder name. In Plumsail the 128 characters applies to the path relative to the document library, i.e. in my instance this is [foldername]/[documentsetname] (all our document sets are being created in subfolders). So in this example and applying the limitation you have cited, there is a 128 character limit to the [foldername] component, and a second 128 character limit to the [documentsetname] - total is therefore 257 characters, as the / is an extra character that doesn't count in that limit. Perhaps you are presuming that all document sets get created in the root level of a library, but that's clearly not a valid assumption, not applicable in my case, and treated differently limits-wise in that table.

Also that screen shot seems to be from SharePoint Server 2010, whereas we are using SharePoint Online, which it seems has a path length limit of 400 characters:

Also within the document set that is created we are subsequently creating documents, so the total path length is even longer with those added in the document set - so the 128 character limit is not a full-path limitation.

We will continue the research of the issue to find out whether there is a workaround for the issue. At any rate, the limit is not set by us. Also, I just would like to notice, that in the case of manual creating a document set, the actual limit for its title is 255 characters (256 with the leading /). We will keep you posted.