You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It can create a folder item in one call in a subfolder. Even now this endpoint can be used with the help of SPHttpClient. The method is rather simple, it's a POST with 2 params: the first one stands for folder relative url, where to create, the second one is FileLeafRef/Title of a folder to create.
For non-modern API this can be used:
constlist=sp.web.lists.getByTitle('ListA');constfolderName='My subfolder';constrootFolder='Folder 1/Folder 2';list.items.add({Title: Util.getGUID(),// The folder is created in a root, so create it first with a temp unique nameFileSystemObjectType: 1,ContentTypeId: '0x0120'// FileLeafRef unfortunately is ignored while creation}).then(({ item })=>{returnitem.update({Title: folderName,// Rename the folder nameFileLeafRef: `${rootFolder}/${folderName}`// Move to a subfolder});}).then(console.log);
For SPO, we can add
AddSubFolderUsingPath
method:/_api/web/GetFolderByServerRelativePath(DecodedUrl=@a1)/AddSubFolderUsingPath(DecodedUrl=@a2)?@a1=...&@a2=...
It can create a folder item in one call in a subfolder. Even now this endpoint can be used with the help of SPHttpClient. The method is rather simple, it's a POST with 2 params: the first one stands for folder relative url, where to create, the second one is FileLeafRef/Title of a folder to create.
For non-modern API this can be used:
Originally posted by @koltyakov in #100 (comment)
The text was updated successfully, but these errors were encountered: