In this post let us see "How can we create an Empty Folder in OneDriveforBusiness" using SharePoint HTTP Action.
As we do not have out of the box action to create Folders in OneDriveforBusiness - we can leverage "Send an HTTP request to SharePoint"
Pre-requisites:
- OneDriveforBusiness URL
- Folder Name to create
Eg: https://{domain}-my.sharepoint.com/personal/{username}/_layouts/15/onedrive.aspx
Steps:
- Go to Microsoft Power Automate | Microsoft Power Platform -> Sign in
- Select the respective Environment
- Click on "Create" -> Instant Flow -> provide a name to the flow name choose "Manually trigger a flow"
- Add an input to the trigger and name it as "folderName"
- Add an action -> "Send an HTTP request to SharePoint"
- Click on "Add a custom item" and enter the OneDriveforBusiness URL and update the action with below parameters
Method: POST
Uri: _api/web/folders
Headers:
Accept: application/json
Content-Type: application/json
Body:
{
"ServerRelativeUrl": "/personal/{username}/Documents/@{triggerBody()['text']}"
}
Comments
Post a Comment