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?
Solved! Go to Solution.
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'])"
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'])"
@aprildunnam Thanks for the reply, i'll have a go at using the formula and let you know how i go. Appriciate the help.
@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.
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'])"
Is this the Compose step your describing? If so this is the error im getting
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
Awesome, that did the trick, thanks for the quick replies 🙂
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).
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.
Within the Disaster Recovery folder there are five files I would like to count. When I run my flow
I get an email with the Output values of 100.
Yes mine also caps at 100 - ive yet to find a solution to this, for me, i just put a condition in saying if its over 100 to send a slightly different notification. Which meets my purpose.
The problem is the Sharepoint folder I'm trying to target only contains 5 files. The email I receive reports the count (Output from the Compose Step) = 100.
Might be bests to create a new topic, someone probally has a solution to that, may even have something to do with the file types? Mine are all PDF's .
Counts are accurate for me under 100, but when our runs have more than 100, it does cap at 100.
Hi,
I tried to replicate the same steps where i'm trying to fetch the total count within site assets library. Flow runs but when checking the count displayed by Microsoft flow it is not tallying with the count being displayed in sharepoint (Navigating to Gear icon --> Site contents--> Site Assets (Count).
Please advise.
Regards,
Kushal Bhowmick
Hi April,
I've just come across this and unfortunately the expression is reporting as invalid. Even if I just type it manually - I'm guessing its been updated or something since this? I've looked at other articles and they pretty much still have this expression as the solution - so I'm kinda stuck. Can you help?
Thanks,
Jason.
As I'm finding often on this forum, the UI or syntax has changed since the solution was posted, so it no longer works.
The SharePoint Get files (properties only) now has 4 lines, and and neither "body" nor "value" returns a list (even though both say they're a list - although you can see "value" has the list icon, and "body' has the ABC icon).
This fails for me with either Compose formula
Hi @Luber
I had tested from my side and found that to resolve the error, all you have to do is just add an Initialize variable action to convert the output into the array.
This is because we understand that the length(...) formula in the expression editor is only able to count the output/data which is array or string only.
Hope this helps ~Get files setting
Choose the right dynamic value
Add initialize variable