Hi everyone -
I am building a flow that will automatically upload an attachment to a Teams folder based upon the parameters that I define. The attachment will always be from the same sender, it will always be sent on a Tuesday, and it will always have the file name beginning with Offer Data Report (no HR) for Recruiting YYYY-MM-DD-HH-mm.xlsx. The date at the end of the file name reflects the Tuesday on which the report was automatically created. I have figured out how to automatically get the email attachment into the Teams folder using the flow below:
The second part is what I am having trouble with...when a new file is created in the Teams folder, I want the file from the previous Tuesday to be deleted (my goal is to only have the most updated version of the report in the Teams folder at any given time). I thought that using a Get files (properties only) action and a Delete files action would be the best way to go. This is how far I've gotten with that:
Does anyone have suggestions on the expression I would put in the Filter Query to only pull the files that were created prior to the date of the most recent file upload? Again, this will always be on a Tuesday and the file name will always contain Offer Data Report (no HR) for Recruiting.
Thank you!