Skip to main content

Notifications

Community site session details

Community site session details

Session Id : Hm7rGiK6n5Ao/LG5Srx1Kx
Power Automate - Building Flows
Suggested answer

Deleting Created OneDrive File

Like (1) ShareShare
ReportReport
Posted on 29 Mar 2025 19:43:07 by 4,643 Super User 2025 Season 1
I have created a flow that populates a Word template, creates a file in OneDrive, converts the
file to PDF, creates that PDF in a SharePoint library, deletes the original OneDrive version of
the file.
 
All is working except the delete. The OneDrive file is not being deleted.

What am I missing?

Delete file:  outputs('Create_file')?['body/Id']
  • Suggested answer
    w.p Profile Picture
    1,524 on 29 Mar 2025 at 23:34:42
    Deleting Created OneDrive File

    Remove the "Create file 3" action and re-add it.

    If it still doesn't work, try to test these actions with a new flow with different files, without "Apply to each" to find the root cause.

  • Phineas Profile Picture
    4,643 Super User 2025 Season 1 on 29 Mar 2025 at 22:31:31
    Deleting Created OneDrive File
    The error is occurring on multiple names. All of the fails are different names.

    The flow worked fine until Feb. 23. I've made no changes to the flow.
  • w.p Profile Picture
    1,524 on 29 Mar 2025 at 21:49:19
    Deleting Created OneDrive File

    Try with a different file name. Do you get the same error every single time?

  • Phineas Profile Picture
    4,643 Super User 2025 Season 1 on 29 Mar 2025 at 20:54:38
    Deleting Created OneDrive File
    Yep, I agree.

    I delete both files before each test and keep getting the same error.

    The SharePoint Library. I've deleted this file before every test.
     

    The OneDrive. I've deleted this file before every test.
  • w.p Profile Picture
    1,524 on 29 Mar 2025 at 20:34:24
    Deleting Created OneDrive File

    The error message indicates that there is an issue with the create file action in SP, not the delete file action.

    Try deleting the files from OD.

  • Phineas Profile Picture
    4,643 Super User 2025 Season 1 on 29 Mar 2025 at 20:23:42
    Deleting Created OneDrive File
    I perceive two issues.
     
    The OneDrive file is not being deleted. I added the delay, but it still didn't delete.

    Also, there is an error regarding the final PDF -
    A file with the name PDF_Work_Order_Library/filename.pdf already exists.

    The file DOES NOT exist in the SP List document library, so I don't know where it
    is seeing this file.

    Both the Word and the PDF files are being created.
     
  • Suggested answer
    w.p Profile Picture
    1,524 on 29 Mar 2025 at 19:52:56
    Deleting Created OneDrive File

    I would suggest adding a delay action before the delete file action.

    What was the output? Did you receive any error?

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,513 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,656 Most Valuable Professional

Leaderboard
Loading started