cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ahmad-KAISPE
Helper V
Helper V

Delete File in OneDrive

Hi all, 

 

I am using a create file action in my flow to create my excel file. now what I want is, at the end of my flow I want to delete a file from OneDrive otherwise flow is generating an error on create file action.

 

here is an flow Screenshot:

con006.PNGcon005.PNG

 

can someone please help me on this as i am facing this error?

 

Thanks

 

Regards

Ahmad.

 

1 ACCEPTED SOLUTION

Accepted Solutions

Problem Solved!


There was no OneDrive file opened but other excel file were opened. as soon as closed all my excel file it worked.

 

Now what I am doing is to check file in contacts folder: take list of file or folder action > delay for 1 min and then delete file

 

Regards,

 

Ahmad.

View solution in original post

7 REPLIES 7
Tom_Slosse
Memorable Member
Memorable Member

Hey @Ahmad-KAISPE 

 

 

I don't know if special characters are allowed in a file name.

This because it is a 400 error you get so either it doesn't exist or you aren't authorized to do so.

 

Also which file do you want to delete, the one that you just created?

If so you can just use dynamic content and search for the filename of your previously created file.

 

 

Kind regards

 

Tom



If this reply has answered your question or solved your issue, please mark this question as answered.

Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

Hi Tom_Slosse, Thank you for your response.

 

No, I am not using any special character in my file name.

 

Yes, I want to delete the same file i have created in OneDrive. In delete action I am using ID from create file action and when i use file name as input it gives an error that invalid id.

 

Thanks.

 

Regards,

Ahmad.  

CFernandes
Super User
Super User

Hi @Ahmad-KAISPE 

 

The Error code is 423, that it means the File is locked. 

 

What I suggest  is you need to wait for the file to be unlocked before executing the Delete file action.

 

You need to add a Delay action on top of the delete file action and delay the execution of the delete file action for a few minutes.

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Hi CFernandes

 

As you can see i have tried this delay action still  i am facing the same issue:

 

con007.PNG

 

Thanks.

 

Regards,

Ahmad.

Hey @Ahmad-KAISPE 

 

 

@CFernandes is right, but normally files don't get locked after creation so maybe you are testing with the file being open?

As Fernandes suggested add a Delay action in front of the Delete File action and set it to 1 minute and see what happens.

 

If this doesn't help make sure no OneDrive files are open and test again.

 

Kind regards

 

Tom



If this reply has answered your question or solved your issue, please mark this question as answered.

Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

Problem Solved!


There was no OneDrive file opened but other excel file were opened. as soon as closed all my excel file it worked.

 

Now what I am doing is to check file in contacts folder: take list of file or folder action > delay for 1 min and then delete file

 

Regards,

 

Ahmad.

@Ahmad-KAISPE  I am glad that your problem is resolved.. 

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (2,276)