Power Automate - How to filter SharePoint Folders and SubFolders & Delete Files?

Поділитися
Вставка
  • Опубліковано 15 січ 2025

КОМЕНТАРІ • 57

  • @fundivine
    @fundivine 11 місяців тому +1

    You just earned a new follower today, this Particular problem has haunted me for hrs, using this i can also get a files link and display it on web through my power appps, i can trigger a delete action for tiles through power apps . thank you so much

    • @abm4975
      @abm4975  4 місяці тому

      Thanks a lot

  • @jinokuriakose2646
    @jinokuriakose2646 Місяць тому +1

    Thanks for sharing this video. Helped me a lot.

    • @abm4975
      @abm4975  13 днів тому

      Glad it helped

  • @chipile
    @chipile 8 місяців тому +1

    This is awesome! Many thanks! Do you have something to copy files to another SharePoint library whose names match certain expression (not equal, but contains)? Thanks again for your wonderful content!

    • @chipile
      @chipile 8 місяців тому +1

      Nvmnd, I figured out how to do it, thanks for the amazing content!

    • @abm4975
      @abm4975  5 місяців тому

      Thanks a lot

  • @bc67
    @bc67 7 місяців тому +1

    Thank you for sharing. Throughout the hierarchy, I have 2 sub-folders with the same name. How would I modify this Flow to delete all the files in only one of the sub-folders?

    • @abm4975
      @abm4975  6 місяців тому

      Get folder meta data using path to find the id. Then try to use the delete item using the id from the meta data. I haven't tested this but have a go. Always try this in a test folder or something. Then makes sure all ok.
      Thanks

  • @ananthakrishnan7060
    @ananthakrishnan7060 3 місяці тому +1

    What if i need to delete all the files in the subfolder and the naming is not consistent..?

    • @abm4975
      @abm4975  3 місяці тому

      Hi
      Follow the below steps:
      Use the Get Files (properties only)
      Set your library name, folder and say include nested items Yes
      Under the Filter Query use
      FSObjType eq 0
      This will get all the files only not any subfolders.
      Then use the delete file and use the identifier from the previous step to delete the file.

    • @ananthakrishnan7060
      @ananthakrishnan7060 3 місяці тому +1

      @@abm4975 Hi i did this with a few other references and got the issue sorted. Thank you so much for your response and the video

    • @abm4975
      @abm4975  3 місяці тому

      That's great to hear that all sorted. Wishing the best.

  • @chandramohan1349
    @chandramohan1349 Рік тому +1

    Thanks for the video, my question is similar. I would like to know the main folder name when the file is submitted in a nested subfolder. If i ask in this video, is there a way to get ITA001/002/003 when file submitted in Price List folder?

    • @abm4975
      @abm4975  Рік тому

      Hi
      Check when a file is created trigger?

  • @shathike4079
    @shathike4079 6 місяців тому +1

    Thanks for good informatic video, When a file is deleted approval workflow is required whether approve / reject

  • @halvadandu
    @halvadandu 5 місяців тому +1

    I want to migrate or copy SharePoint nested folders to another SharePoint tenant. The folder count is huge and data is around 2 tb. Can you help me

    • @abm4975
      @abm4975  5 місяців тому

      For 2 tb I probably won't use Power Automate. You might hit with the API daily limits. Have a look on other third party tools or custom SharePoint API code to do the migration.

    • @halvadandu
      @halvadandu 5 місяців тому

      @@abm4975 thanks for your valuable response.
      Would you help me with detailed steps please?

  • @markyaney9820
    @markyaney9820 Рік тому +1

    I am looking for a flow similar to this. What I have happening currently is a flow that populates a MS Word doc from an MS Forms entry. My flow then copies the word doc and converts it to a pdf file. Once the flow is complete I have both the .docx file and the .pdf file in the SharePoint folder. I have been unsuccessful adding a step to delete the .docx file within the flow. What I am trying to create now is a flow that will go into the sub folder once per month and delete all the .docx files except for my template. All the created .docx files end with "-VIF.docx". Is there a way to create a flow that will filter the array in the folder and delete all files that contain "-VIF.docx"?

    • @abm4975
      @abm4975  Рік тому

      Hi
      Thanks for the question. Have a look on this video
      ua-cam.com/video/LG8aFEutJyU/v-deo.html
      Once you get the file use split() expression to find the extension or add an IF condition and ending with -VIF.docx, then delete the file.

  • @eduardoalmeida4692
    @eduardoalmeida4692 Рік тому +1

    I cant do this. My flow says it was run ok, but the files on path folder still there. It is already makes me mad.

    • @abm4975
      @abm4975  Рік тому

      Could you post the details with a screenshot in Power Automate community.
      powerusers.microsoft.com/t5/Building-Flows
      Tag me as @abm
      I will have a look.
      Thanks

    • @eduardoalmeida4692
      @eduardoalmeida4692 Рік тому +1

      @@abm4975 Hello.......It finally worked....... I did all the same thing. I Guess was some bug with power automate. Now, when I received a specifc mail, it delete all files in this folder, and save the new one from that mail. Thanks!!!

  • @jamillelopes3489
    @jamillelopes3489 Рік тому +1

    How does it work for a folder that contains a large amount of subfolders, like 1500 (and is constantly adding more of them)?

    • @abm4975
      @abm4975  Рік тому

      You may need to look for scheduled trigger and run every day or something.

  • @KshitijaK-v3w
    @KshitijaK-v3w 4 місяці тому +1

    Thank you for the video .Much appreciate !!
    Could you please let me know how I can delete a files with modified date in sub folders ?

    • @abm4975
      @abm4975  4 місяці тому

      So extend the filter using modified date. The expression you need is
      utcNow() expression. formatDateTime(utcNow, 'yyyy-MM-ddT00:00:00)
      Then use Delete file and pass the file identifier to delete the file. If you have any further questions please let me know.
      Thanks

  • @senthamilankrishnan6299
    @senthamilankrishnan6299 Рік тому +1

    Hai abm,
    I have a excel file in SharePoint documents library i want to delete a excel sheet. I had tried your steps but I got some error please tell me whether it will work for SharePoint or one drive

    • @abm4975
      @abm4975  Рік тому

      Hi
      What's the error you getting?
      Thanks

    • @senthamilankrishnan6299
      @senthamilankrishnan6299 Рік тому

      @@abm4975 why are deleting my comment dude.if you don't know just leave somebody who knows the answer he will reply

    • @abm4975
      @abm4975  Рік тому

      Hi
      I did replied to you two days ago asking what's the error you getting? Not sure why you comment something like that?

  • @manjunathak4822
    @manjunathak4822 2 роки тому +1

    Can you please do video how to get size of file attached in powerapps app in power automate or in powerapps

    • @abm4975
      @abm4975  2 роки тому +1

      Hi
      Please have a look at this thread.
      powerusers.microsoft.com/t5/Building-Flows/Get-the-exact-file-size-in-kb-or-mb-format/td-p/1458351
      Thanks

    • @lerishamendonsa3126
      @lerishamendonsa3126 2 роки тому

      Hii can you make a flow on how to delete mails which are older then 7 days ..
      It would be a great help.. please sir.

  • @NiallJohn
    @NiallJohn Місяць тому

    Hi, we have a sharepoint tenancy with over 400 subsites that contain document libraries i.e. Documents, Library n1.
    We are trying to block uploads of specific file types (e.g. exe, bat, ini) to the libraries. We created a flow to retrieve names of these document libraries, is there anyway to create a flow to block uploads of these file types for all subsites. As there are so many subsites, it is not feasible to create individual flows for all the subsites.
    Thanks for any ideas.

  • @rankas1
    @rankas1 2 роки тому +1

    Hi, Please explain to me how to auto-delete only ZIP files in SharePoint documents.

    • @abm4975
      @abm4975  2 роки тому

      Hi
      Apologies for the late reply. Was on holiday break. Do you still need help in this?
      Thanks

  • @sahil.rajput2000
    @sahil.rajput2000 2 роки тому +2

    Hey abm, can you make a video on how to change the delimiter of a csv file in power automate web. For ex : "," to "|". I tried to search alot on google and youtube can't find any suitable answers. Can you please help us.

    • @sahil.rajput2000
      @sahil.rajput2000 2 роки тому +2

      Input is a csv file with , delimiter and out is a csv file with | delimiter

    • @abm4975
      @abm4975  2 роки тому

      Hi
      Where you storing this file? One Drive or locally?
      Thanks

    • @sahil.rajput2000
      @sahil.rajput2000 2 роки тому +2

      @@abm4975 i am fetching the file from SharePoint location and then saving it on ftp client location using create file action, you can show a demo of saving it on one drive

    • @abm4975
      @abm4975  Рік тому

      Hi
      Apologies bee really busy recently. If you still need help please let me know.
      Thanks

  • @raymchin007
    @raymchin007 Рік тому +1

    Hi, how to delete multiple files with monthly extensions, let's say xxx_Jan, xxx_Feb etc in mutiple folders in sharepoint. The second folder may contain files names yyy_Jan, yyy_Feb etc., and the third folder will contain files names zzz_Jan, zzz_Feb etc., so on and so forth.
    Is it possible to loop and delete all files using one power automate?
    Thank you kindly.

    • @abm4975
      @abm4975  Рік тому +1

      Hi
      Use the expression below.
      formatDateTime(utcNow(), 'MMMM')
      This will give you month name in English. Then use another expression substring() to the first three letters of the month. Then use the filter to set this value.
      Thanks

  • @IAmSreejith
    @IAmSreejith 2 роки тому +1

    Hi, a totally unrealted question. I have a requirement wherein I need to track the refresh of dataflows in a Power BI workspace(s) . I know I can do this using the APIs , but due to the organizational limitations , I can't use it. So the next solution I could think of is to use the Power Automate to do this. I have already created a few flows that do this perfectly, individually. But it is not an intuitive process. Lets say I have 20 dataflows ( and ever growing) , then I need to create 20 different flows to track the status of these dataflows.Rather I would like to have this done dynamically in a single flow itself. Is there a method by which I can parameterize the Dataflow name in "When a dataflow refresh completes" trigger ?
    Another method I am pursuing, but failing :( , is - Schedule the flow to run at a pre-set time > Keep the list of dataflows in an Excel ( dynamically) > List rows present in this excel table > Apply to each .
    Inside Apply to each --> "When a dataflow refresh completes" > use the current row as the dataflowName
    And finally , update a row in Power BI dataset ( streaming ) .
    But this method is failing with "The backend request failed with error code '404'" .
    So, is this even possible ?
    Appreciate if you could reply . Thank you

    • @abm4975
      @abm4975  2 роки тому

      Hi
      I need to see the flow. Did you try creating child flow which can accept the parameters from the parent flow so that you may not need 20 flows.

    • @vanikottapalli0620
      @vanikottapalli0620 10 місяців тому

      Hi Sreejith
      Have you found the solution for getting bi refresh data? I'm having the same issue.

  • @LockeStreetEats
    @LockeStreetEats Рік тому

    Hello, this is beautiful! Would you be able to show us how to copy a document to the subfolders?

    • @LockeStreetEats
      @LockeStreetEats Рік тому +1

      I have built a document template that I need several subfolders to have. I can go in manually to drag and drop into each subfolder, but that takes quite some time.

    • @LockeStreetEats
      @LockeStreetEats Рік тому +1

      NVM I figured it out

    • @abm4975
      @abm4975  Рік тому +1

      Fantastic and thanks for letting me know.

    • @LockeStreetEats
      @LockeStreetEats Рік тому

      @@abm4975 Thank you for replying! I tested this in a test site and it worked. I tried running it in a library that has 150 folders + and it only added my file to four of the clients within the library. Is there a way to make it work in big lists/libraries. Or is 4 the max?

    • @LockeStreetEats
      @LockeStreetEats Рік тому +1

      @abm hehe, nevermind again... It was an easy fix. I updated the get file properties to yes, include nested items and entered 300 in the top count, and to use all columns (do not limit). Not sure if I needed to change all of these, but I thought it couldn't hurt to try.

  • @Ron_95
    @Ron_95 10 місяців тому

    Thanks for the informative video, I want to create a flow which can be triggered using files placed inside a specific subfolder called "Translation Docs" inside our sharepoint library and it should pick that file [Take user input for "Target language"] and open another utility i.e. Document translation (this utility is created inside our organization sharepoint) and navigate to that to put that selected file as input and generate the output. also place the output file in a specific output folder inside the same library. If you could help me with the first part i.e. getting the files from sharepoint and navigating to some other url in sharepoint that would also be very helpful. Thanks!