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

Move files to another folder by date created

I have a flow that creates a number of excel files each day in a folder that also contains python scripts.

At the end of the flow I want to move the excel files created that day into another folder

The Move action variable lists and sorts the files but i can't figure out how to move only those created today

This is  a sample list sorted in descending order

GJH_0-1670524033317.png

 

  

1 ACCEPTED SOLUTION

Accepted Solutions
momlo
Solution Sage
Solution Sage

Hi @GJH 

 

Option 1:

Once you have a list of files, use "For each" loop and check "CreationTime" for each file

You can access it the following way: %File.CreationTime%

 

Option 2:

1. At the start of the flow - create list of the files in the fodler

2. At the end of the flow - create second list of the files

3. Find the delta using Subtract Lists

4. Move files

 

Variables actions reference - Power Automate | Microsoft Learn

 

I would go with Option 2- cleaner, less code

 

View solution in original post

2 REPLIES 2
momlo
Solution Sage
Solution Sage

Hi @GJH 

 

Option 1:

Once you have a list of files, use "For each" loop and check "CreationTime" for each file

You can access it the following way: %File.CreationTime%

 

Option 2:

1. At the start of the flow - create list of the files in the fodler

2. At the end of the flow - create second list of the files

3. Find the delta using Subtract Lists

4. Move files

 

Variables actions reference - Power Automate | Microsoft Learn

 

I would go with Option 2- cleaner, less code

 

GJH
Frequent Visitor

Momlo

Thank you. Yes your List option works well and is the better option - I dislike loops!

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (2,334)