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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Flow to Count files in...
Power Automate
Answered

Flow to Count files in a Sharepoint Folder

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello, 

 

We have a task that requires a staff member to process files in a group of sharepoint folders, and once completed, move the file into a "Done" folder. 

I want to create a flow that runs daily via the Recurrence Trigger, does a count of all the files within the root folder, and adds that to a variable to be emailed.  

Any advice/ideas on the best way to go about doing this?

Categories:
I have the same question (0)
  • aprildunnam Profile Picture
    704 on at

    You can use the Get Items Action and point that to your SharePoint Library.  Then add a Compose action and use this formula to get the number of items:

     

    "@length(body('Get_items')?['value'])"

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @aprildunnam Thanks for the reply, i'll have a go at using the formula and let you know how i go. Appriciate the help. 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @aprildunnam Tried the Get Items function, but this seems to only pull from a sharepoint list, but i want to count the files in a folder. 

     

    Capture.PNG

  • Verified answer
    aprildunnam Profile Picture
    704 on at

    Sorry I should've read your message better. You need to use Get Files Action instead.  That one lets you get documents from a library.  

     

    The formula would be slightly different.  Need to change it to the name of the Get Files action

     

    "@length(body('GetFiles')?['value'])"
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Is this the Compose step your describing? If so this is the error im getting

     

    Capture.PNGCapture2.PNG

  • aprildunnam Profile Picture
    704 on at

    Yes that's it. The issue is the text where is says "Get Files" in the parenthesis needs to match the name of your action above.  So if you click the "..." in your Get Files action and rename it to "GetFiles", just like that, all one word then the compose action will work

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Awesome, that did the trick, thanks for the quick replies 🙂 

  • scoombs Profile Picture
    12 on at

    Can you provided a little more inforamtion about the Get File Action. Under Sharepoint I see no option for Get Files alone. There is Get File Properties, and Get Files (Properties Only). 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @scoombs i used Get Files (properties only) for sharepoint.

  • scoombs Profile Picture
    12 on at

    Im also trying to get a file count on a folder within Sharepoint. I've setup a recurrence schedule to send out email every hour. This folder is under another folder. The address appears http://mysharepointsite. sharepoint.com/site/IT and a directory under IT.  

    SharepointFolderTocount.png

     

    Within the Disaster Recovery folder there are five files I would like to count. When I run my flow 

     

    FileCount.png

     

    I get an email with the Output values of 100. 

     

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 283

#2
David_MA Profile Picture

David_MA 256 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 225 Most Valuable Professional

Last 30 days Overall leaderboard