Monday, July 15, 2024
HomeMicrosoft 365Breaking the Connection and Deleting Folders from OneDrive with Power Automate

Breaking the Connection and Deleting Folders from OneDrive with Power Automate

OneDrive is a popular cloud storage solution that allows users to store and access their files from anywhere. With OneDrive, users can easily collaborate and share files with others. However, sometimes it’s necessary to break the connection between OneDrive and another service, such as SharePoint, and delete a folder. This can be accomplished easily with Power Automate, the workflow automation tool from Microsoft.

In this article, we will explain how to break the connection and delete folders from OneDrive using Power Automate.

Step 1: Create a new flow in Power Automate To start, create a new flow in Power Automate. Choose “OneDrive for Business – When a folder is deleted” as the trigger. This will allow the flow to trigger when a folder is deleted from OneDrive.

Step 2: Select the folder to delete Next, select the folder in OneDrive that you want to delete. This can be done by specifying the folder path in the “Folder ID” field. Alternatively, you can use the dynamic content feature to select the folder dynamically.

Step 3: Choose an action to take Once you have selected the folder to delete, you need to choose an action to take. In this case, you want to break the connection with SharePoint and delete the folder from SharePoint as well. To do this, choose “SharePoint – Delete file” as the action.

Step 4: Specify the file path in SharePoint Specify the file path to the folder in SharePoint that you want to delete. This can be done by entering the file path in the “File identifier” field. Alternatively, you can use the dynamic content feature to select the folder dynamically.

Step 5: Save and test the flow Finally, click on “Save” to complete the process. You can then test the flow by deleting the folder in OneDrive and checking that the folder has been deleted from SharePoint as well.

Example:

  1. Open Power Automate and create a new flow.
  2. Select “OneDrive for Business – When a folder is deleted” as the trigger.
  3. Choose the OneDrive account and folder that you want to monitor for deletions.
  4. Next, add an “If/else” action to the flow.
  5. In the “If” condition, specify the criteria that will trigger the action to break the connection and delete the folder from SharePoint. For example, you may want to specify that if the folder is deleted from OneDrive, it should also be deleted from SharePoint.
  6. In the “Then” condition, add a “SharePoint – Delete file” action.
  7. Specify the SharePoint account and the path to the folder that you want to delete.
  8. Save the flow and give it a name.

Most Popular