cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Need help building a flow to move files older then 1 year

Hello,

 

I am trying to build a flow that moves files that are 1 year or older from one document library to another. 

 

I had this working before with this setup but it doesn't seem to be working anymore.

 

It is a scheduled flow to run once a day. Get file (properties only) Filter Query = Created It 'addDays(utcnow('yyyy-MM-ddTHH:mm:ssZ'),-365)' > Apply to each (Value) > move file

 

2020_11_02_11_15_07_Edit_your_flow_Power_Automate.jpg

7 REPLIES 7
fchopo
Super User
Super User

Hello @Anonymous 

Could you specify your problem? I mean, is the flow still working but the results aren't the expected ones? Or are you receving any kind of error message?

Regards,

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!
Anonymous
Not applicable

I get an error now. Just to test to see if it would work I changed the date to 7 days to see if it would move the file in there but the flow errors out right at get file ( properties only) action 

 

error: The expression "Created It '2020-10-26T19:53:07.0000000Z'" is not valid. Creating query failed.
clientRequestId: 23ef9211-1cbe-4175-93f7-101ab26bba1a
serviceRequestId: 23ef9211-1cbe-4175-93f7-101ab26bba1a

 

2020_11_02_11_54_31_Run_History_Power_Automate.jpg

Hello @Anonymous 

Could you check wether the "created" colum name is still valid (I guess so, but just in case) ?

And could you replace the expression with a fixed date and test the flow again? In this way we will see if the error is about the expression or someting with the get items action.

Regards,

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!
Anonymous
Not applicable

Here is a screenshot of the library with the columns 

 

2020_11_02_12_14_54_Contracts_Legal_AETN_All_Documents.jpg

 

How would the expression go for the fixed date? 

 

 

And what about the internal name of the column? Could get the output (the json data) of the get items action without the filter ?

Regards,

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!
Anonymous
Not applicable

2020_11_02_12_26_11_Document_Library_Settings.jpg

I ran the flow without the expressions and got an error on the move file action 😞

 

2020_11_02_12_27_18_Run_History_Power_Automate.jpg

error: Missing or mismatched field definition on the destination list for source field 'Client' type 'Text'. Source site template id 'TeamCollaborationSite', target site template id 'TeamCollaborationSite'. Total blocked root objects in this operation is [1].
clientRequestId: 730b8258-a9d2-432f-a660-e8d27d076e53
serviceRequestId: 730b8258-a9d2-432f-a660-e8d27d076e53

 

Hello @Anonymous 

Really difficult to help you as we don't know the data structure and type of fields you have in your SharePoint list.

I created a very simple flow to get the items using the same expression you shared, and it works!

time_expression.png

 

 

So, try again with the expression and let us know.

Regards,

Ferran

 

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

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.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (4,729)