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

Community site session details

Session Id : eov6EqBC/8sJBHXJmRPABS
Power Automate - Building Flows
Unanswered

Deleting file in SharePoint

Like (1) ShareShare
ReportReport
Posted on 28 Mar 2017 10:47:36 by 4

Hi,

Have a problem deleting a file previously created in SharePoint with Flow. 

It is a delete file when item created flow; as i am using a tasklist, when a new item is created i used a different flow to create files (actually wanted just the folders but this is a good work-around) and the thing is that i want those files deleted automatically so just the folders remain. The thing is that flow does not seem to find the file. It is the only file in the library. Please prompt me for more details if you think you may have an explanation or a solution.

Thank you.

I have the same question (0)
  • v-yamao-msft Profile Picture
    on 30 Mar 2017 at 07:12:56
    Re: Deleting file in SharePoint

    Hi SonOfRainFall,

     

    If I understand you correctly, you are trying to create a flow to delete a file in SharePoint library when a new item is created in list. Looks like below:

    1.png

     

    But it seems that the action “delete file” only allows us to select a certain file from the library, if you want to delete several files, it might be impossible.


    If I understand you correctly, please consider to create a feature request on Flow Ideas Forum at here:
    https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

     

    If I misunderstand you, please feel free correct me and please provide more details about your scenario for better understanding.

     

    Best regards,
    Mabel Mao

  • SonOfRainFall Profile Picture
    4 on 30 Mar 2017 at 08:05:47
    Re: Deleting file in SharePoint

    Hello,

    Thank you for the reply.

    One file is indeed what i want to delete. THe problem is, that is do not have a fixed adress for the file. I need to use dynamic content in the adress. Like so:flow_delete file.JPG

     

     

     

    The file in question is a .txt file that is created automatically by another flow on the creation of the same item in my tasklist.

    The problem is: it finds the lybrary using dynamic content, (or so the error log explains ) but it cant find the txt in the lybrary.

    I tried using the following file name paramaters: .txt , dynamic values for ID, NameTag, Task Name (the same used for the adress) even all of the above with .txt at the end. Is it that it can;t find the lybrary because of dynamic content or it doesan't recocnise the file name given trough dynamic content, just a specific name?

    If needed i can explain and ilustrate the whole process and folder/lybrary structure i need. Thank you.

  • sameli Profile Picture
    2 on 29 Jun 2017 at 08:28:04
    Re: Deleting a file in SharePoint where created/modified date is greater than 3 months

    Hi,

     

    Does any one have tried creating a flow to delete a file from SharePoint where in created date/modified date is greated than 3 mos/specified date?

     

    I am trying to look for the trigger for SharePoint to delete a file but not available.

     

    Is there a way or work around to do this?

     

    Thanks.

  • remy730 Profile Picture
    3 on 08 Nov 2017 at 16:06:19
    Re: Deleting file in SharePoint

    Hello,

     

    Have you found a solution for this?  I too, am having this problem.  I created the delete file step and inserted the site address.  In the File identifier field, I am able to find the file that I want to delete in the search box and it deletes the file but, if I type that same information in the box manually, it doesn't work; with or without inserting dynamic content.  I cannot hard code a file deletion because I will not know the name of the file that is being uploaded.

  • PatrickOToole Profile Picture
    11 on 18 Oct 2018 at 20:05:15
    Re: Deleting file in SharePoint

    Hello,

    Not sure if this helps, but I ran into this problem as well. I tried building the URL dymanically too (as I was using dynaically created folders), but it turns out we don't need to!

    -Leave the Site Address as is. My Site URL is blurred out but looks like https://tenantName.SharePoint.com/sites/siteCollectionName

    -Use "ID" as the File Identifyer. Make sure to use the ID field from the newly created document.

     

     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 655 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 371 Moderator

#3
chiaraalina Profile Picture

chiaraalina 276

Last 30 days Overall leaderboard
Loading complete