I built a flow with a recurrence schedule to run daily to archive or delete based on old files (older than 7 days) with user input from notification email. The issue is it also emails for approval about the folder names within Documents library - I just want to notify about the files within the folders or target a folder within the library. How do I do that?
There is a SharePoint property that is called IsFolder.
If you use this you can check whether it is a file or folder.
If it is a folder you should do nothing, if it is a file you can do your other actions.
Hope this helps
I tried this but I get no notification email at all because I set the value of isFolder to true and put my actions under "If no"
I know it is annoying but you have to use the expression to make it equal to true.
So you have go into the field and choose Expression and type true and click the expression, then click Ok.
I actually did do that as I understand how the expression works. It appears to be skipping the "if no" actions since the condition is true. The screenshot above is what the results are.
Weird because if I replicate your Flow it works fine with me, well fine the Flow keeps running and I canceled the Flow but I still got the email for it.
So it is weird that your Flow doesnt want to go through.
And did you use the expression with true like i described in my previous message?
I will try again but I can also export my flow and send it to you if you like so you can see if you can reproduce the issue.
Could you please share a full screenshot of your flow's configuration?
Do you add two filter Conditions to check if the item is a folder within your flow?
I think it is not necessary to add two filter Conditions to check if the item is a folder within your flow, I have made a test on my side and please take a try with the following workaround:
Add a Condition, left input box set to IsFolder dynamic content of the "Get file metadata" action, right input box set to true, within middle drop down, choose is equal to.
Within "If/no" branch of Condition, add a Condition 2, click "Edit in advanced mode", type the following formula:
@equals(utcNow('MM/dd/yyyy'), formatDateTime(addDays(item()?['Created'], 7), 'MM/dd/yyyy'))
Within "If/yes" branch of Condition 2, add a "Start an approval" action.
Note: Under the "Start an approval" action, you could add other actions that you needed.
Kris thanks for the detailed flow! I attached the updated flow based on what you provided.
The flow does run successfully this time however it is still including the folders in the approval email, see below please. In this example, General is the folder name. If I choose an action, eventually I get a notification email for the documents in the folder but I want to exclude folders from in the notification email since the flow only works against files.
Attached is the flow built below
Have you had an opportunity to apply @Diego‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify! Thank you for being an active member of the Flow Community!
Flow Community Manager
We've updated and improved the layout and uploading format of the Power Automate Cookbook!
Fill out a quick form to claim your user group badge now!
We've given our badges an overhaul and also added some brand new ones!
Learn how to build the business apps that you need.
Find out where you can attend!
Watch & learn from the Power Automate Community Video Gallery!