0

We have a SharePoint document library which contain around 100 main sub-folders, now i want to implement a scheduled flow which loop through all the main sub-folders >> and check if each main folder contain at-least one file (of any type) >> if so to set the folder status to "Completed" >> if not (the folder is empty or contain only sub-folders) to set the status as "Pending"?

Is this possible?

1 Answer 1

1

I suggest using the "Get files (properties only)" sharepoint action on your mail folder to retrieve all sub folders. Make sure to set the parameter "Include Nested items" to false so you'll only get sub level 1 folders.

After that I would loop through all subfolders doing a "Get files (properties only)" and use a condition to check "IsFolder" attribute equals false. Increment a variable in case a file is found. When the loop is done, if the variable is incremented you know there is a file present in the subfolder and you can do an "update file properties" to set the status of the folder to "completed".

Something like this:

enter image description here enter image description here enter image description here

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.