Skip to main content

Notifications

Community site session details

Community site session details

Session Id : dHR8aWPbKYAnN5ff3hC5qy
Power Automate - Building Flows
Answered

Delete File after added to SharePoint List

Like (0) ShareShare
ReportReport
Posted on 25 Feb 2023 17:35:05 by 20

Hello together,

 

I've created a flow that collects informations and documents using Microsoft Forms. The flow works fine. In this flow, a file will be uploaded and save in my OneDrive. Now I want the document to be deleted afterwards. I'm trying to use the following actions

 

Bildschirm­foto 2023-02-25 um 18.31.46.png

 

But I always get the following error message.

Bildschirm­foto 2023-02-25 um 18.32.53.png

 

Can anybody tell me, what I'm doing wrong?

 

Kind regards

 

Kai

  • Community Power Platform Member Profile Picture
    on 26 Feb 2023 at 14:02:24
    Re: Delete File after added to SharePoint List

    Hello Tom,

     

    It worked 🙂

     

    Thank you very much and have a nice Sunday.

     

    Kind regards

     

    Kai

  • Matthy79 Profile Picture
    4,178 Super User 2024 Season 1 on 25 Feb 2023 at 19:26:07
    Re: Delete File after added to SharePoint List

    Hello @Kai_U_P

     

    You need the ID of the file when using this action. You can get the ID by using something like "Get file metadata using path" (I don't know what it is called in German). I would also recomment to switch Power Automate to English. It will help you to find actions and it is easier to understand what you are doing for people here.

  • Verified answer
    tom_riha Profile Picture
    10,085 Most Valuable Professional on 25 Feb 2023 at 19:25:40
    Re: Delete File after added to SharePoint List

    Hello @Kai_U_P ,

    when you 'Peek code' on the 'Delete file' action you'll see that the action doesn't use the file path, it uses the file ID.

    image.png

    To delete the file you'll need to get its ID first with the 'Get file metadata using path', that'll give you the file ID and you can delete it.

    image.png

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

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,679 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard
Loading started
Loading complete