cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

I built a flow for archiving or deleting files older than 7 days but its including folders

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?

 Screenshot_1.png

 

15 REPLIES 15
Memorable Member
Memorable Member

Hey @BTHB

 

 

 

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

 

Kind regards

 

 

Tom



If this reply has answered your question or solved your issue, please mark this question as answered.

Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

Thanks Tom

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"

 

see below

 Screenshot_1.png

 

Frequent Visitor

heres the output of the flow 

 

Screenshot_2.png

Hey @BTHB

 

 

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.

True_Expression1.PNGTrue_Expression2.PNG

 

 

 

 

 

 

 

 

 

 

Kind regards

 

 

Tom



If this reply has answered your question or solved your issue, please mark this question as answered.

Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

Hi Tom,

 

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.

 

Thanks

HB

 

Hey @BTHB

 

 

 

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?

 

Kind regards

 

 

Tom



If this reply has answered your question or solved your issue, please mark this question as answered.

Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

Hi Tom

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.

 

Thanks

HB

Frequent Visitor

The condition is still not satisfied

Is it because i am using a nested condition? 

 

see.png

Hey @BTHB

 

 

You can export your Flow, I will look into it.

And will let you know if I find something

 

Kind regards

 

 

Tom



If this reply has answered your question or solved your issue, please mark this question as answered.

Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

Community Support
Community Support

Hi @BTHB,

 

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 Recurrence trigger, Interval set to 1 and Frequency set to Day.
  • Add a "Get files (properties only)" action, specify Site Address and Library name.
  • Add a "Apply to each" action, input parameter set to output of "Get files (properties only)" action.
  • Within "Apply to each" action, add a "Get file metadata" action, specify Site Address and File Identifier field set to Identifier dynamic content of the "Get files (properties only)" action.

         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.

 

Image reference:17.JPG

 

18.JPG

 

 

Note: Under the "Start an approval" action, you could add other actions that you needed.

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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. 

 

 approvals.png

 

 

 

Attached is the flow built below

 

flow1.pngflow2.pngflow3.png

Frequent Visitor

any update on this would be appreciated 

Frequent Visitor

bump

The flow in the following post could give a solution to your problem using a query filter:

 

Flow

Hello, @BTHB!

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!

 

-Gabriel

Flow Community Manager

- Gabriel
Community Manager
Power Automate | Power Virtual Agents
Super User Program Manager
Power Platform Communities

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (9,346)