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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Getting properties of ...
Power Automate
Unanswered

Getting properties of all subfolders within a main folder

(0) ShareShare
ReportReport
Posted on by 68

Trying to get the name of each SharePoint folder inside of a main folder using Power Automate and then compare it with a column value in a SharePoint list. And then if these values match, if the folder name contains the value that is in the list column, to move that same subfolder to a new location. So let's say we have a main folder entitled Library1 and inside of it we have many subfolders with different names. And then we have a SP list. I want when a new item is submitted in that list, to get the value of let's say the Title of the submitted item, compare it to all subfolder names in the main Library1 and if it finds a subfolder name that contains the value from the list item Title field, to move the matching subfolder with its content to a new location. Any ideas would be appreciated!

Categories:
I have the same question (0)
  • danvarga Profile Picture
    Microsoft Employee on at

    Hi @benny_blanco ,

     

    Unfortunately, Power Automate does not have an action for getting a list of folders. You can get the folder metadata, but is only for one folder. I was thinking about this a way to do this and maybe works if you get all folders from Power Shell and then execute the Power Shell in Power Automate.

    Here is a PowerShell  for getting the information: http://johnliu.net/blog/2018/4/run-any-pnp-powershell-in-one-azurefunction-from-microsoft-flow

     

    And here you can find an example for executing a script in Power Automate: http://johnliu.net/blog/2018/4/run-any-pnp-powershell-in-one-azurefunction-from-microsoft-flow

     

    Hope it helps. 

  • Verified answer
    benny_blanco Profile Picture
    68 on at

    I managed to make it work with Power Automate alone. So basically what I did is to trigger the automation when a new item is created in the list. Then get the list item via the Get item action. After that I used the List folder action to get the information of the mentioned folder. Then I used the Filter array to check only for folders within that folder, so any other files could be skipped. And after that I'm comparing if the Name of the folder contains the Title of the list item, to move that folder with all of its content to a new destination.Here's the Flow and the way I've set it:

     

    move folders.PNG

    move folders2.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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard