web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Delete File in Onedriv...
Power Automate
Unanswered

Delete File in Onedrive for Business

(0) ShareShare
ReportReport
Posted on by

Hello,

 

A) I want to delete all under the test folder.

 

B) Delete "test / test.txt" as a test. I get an error in "Delete File".

 

   "status"400,
  "message""The provided drive id appears to be malformed, or does not represent a valid drive.",
  "source""api.connectorp.svc.ms"

 

 

Categories:
I have the same question (0)
  • v-xida-msft Profile Picture
    on at

    Hi @Anonymous,

     

    Could you please share a screenshot of your flow's  configuration?

     

    The error message told that you have provided a invalid drive (drive id or file) within "Delete File" action of OneDrive for Business connector. I have made a test on my side (Delete "Test/text.txt" as a test) and don't have the issue that you mentioned. My flow'c configuration as below:4.JPG

    The flow works successfully as below:5.JPG

     

    Please check if you have specified a proper file within File field of "Delete file" action. In other words, please check if the file that you specify within File field of "Delete file" action is existed in your OneDrive for Business folder.

     

    In addition, please check if the connection to the "Delete file" action is invalid, if yes, please update the connection to the "Delete file" action or re-create a new connection to this action, then try your flow again to check if the issue is solved.

     

    If you want to delete all files under a OneDrive for Business folder, please take a try with the following workaround:

    • Add a proper trigger, here I use Flow Button trigger.
    • Add a "List files in folder", specify Folder and Include subfolders set to Yes.
    • Add a "Apply to each", input parameter set to output of "List files in folder" action.
    • Within "Apply to each" action, add a "Delete file" action, File field set to Id dynamic content of "List files in folder" action.

    Image reference:6.JPG

    The flow works successfully as below:7.JPG

     

     

    Best regards,

    Kris

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard