Showing results for 
Search instead for 
Did you mean: 
Regular Visitor

Archive an old file in SharePoint when a new one comes in

Hi Everyone,


Was hoping to get some help please. I am very new to power automate and I am trying to setup a flow for archiving old files. Currently I have a flow setup where when a particular email with a particular attachment comes through a copy is saved in SharePoint.   What I want to do is each time a new version of the file comes through I want the old copy in SharePoint to be moved to an archive file.  I have found this thread where this exact problem was raised and solved for someone else, however I cannot seem to get it to work.


I have the same issue where the file name is slightly different due to the date (YYYY-MM-DD) changing at the end of the file name each time. With the original solution the flow was working, but it wasnt archiving the old file and was just sending the new file through to the archive as well as creating another copy in the current folder, due to the change in name of each file.  I have then tried using the solution suggested in the above thread where I add in the condition suggested.




However when I run this I get the below message.




I am sure its something simple I have missed, but with my limited knowledge I am not sure what it is. Any help anyone could give would be greatly appreciated. Cheers.


Helpful resources

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Users online (2,143)