Improve folder creation for SharePoint lists
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 413
- Avg merge
- 5d 6h
- Merged PRs (30d)
- 21
Description
When creating a folder in a SharePoint list using the REST API (and through the spo folder add command), the operation reports success, but the folder never shows up in the list view.
Digging deeper, you’ll see the folder is technically created when inspecting the rootFolder via REST, but it lacks any metadata, making it an internal-only folder that's invisible in the UI and unusable.
After quite a bit of searching, I found that using a different endpoint actually creates the folder properly with the required metadata:
/_api/web/GetFolderByServerRelativePath(DecodedUrl='/sites/examplesite/Shared Documents')/AddSubFolderUsingPath(DecodedUrl='NewFolder')
This endpoint ensures the folder is correctly surfaced and behaves as expected. I think we should update the spo folder add command to use this endpoint when targeting folders in lists. It may also be worth checking if other folder-related commands are affected by similar issues.
Has anyone else run into this before?
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.
Research direction
Start with the spo folder add command and compare its current folder-creation request with the SharePoint AddSubFolderUsingPath endpoint shown in the issue. Verify the resulting folder appears in the list view with metadata, and check whether related folder commands show the same behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100