Hi everyone,
Previously I had created a automated flow (that gets triggered every Monday morning) which contains all employee details (like name, email and dates of the current week excluding weekends). The employee information was retrieved from a Teams group and the excel file was shared in the Teams channel (named: Attendance), the flow looked like this:

(The varcounter acts like a counter to count the members, initially I am creating the excel file in my OneDrive and then in Microsoft Teams group).
In the teams channel the files are uploaded as follows:

So as you can see all the files are reside here (the highlighted file is the latest one i.e. for the current week) but currently the structure looks a bit messy that is every week the user explicitly has to order the files (by clicking on Modified) so the latest file comes at top, instead I was thinking is there a way that we can move all the files except the latest one into an Archive folder and only the latest file (currently : Attendance_15_04_2024.xlsx at root level and all the other files in another folder) like:

And all the files that are in archive should not be editable to users (except Owner which incase is me). So I thought about a way like constructing a recurrence flow (automated flow) that runs on every Monday but after some time (like my first flow runs around 9:30 am so this flow can run around 10 am to avoid any issues) and then compare all the file creation date/modified date with current date if it matches then skip that file (don't move it) else move it to the sub-folder (Here its named Folder/Archive folder)
So I was thinking of some expression like:
['LastModified'],'yyyy-MM-dd'),formatDateTime(utcnow(),'yyyy-MM-dd')
But not sure whether it is correct. The excel file that gets generated looks as follows:

And the automated message that is sent in the Teams channel every start of the week (Monday morning)

And once the file is moved into the Archive folder : They should not be editable to the users/members of the Teams channel (except the owner: which in this case will be me), so for this do we need to create 2 different flows one to move files into archive folder and other to revoke permissions or can it be done in flow itself?.
If anyone has any idea about the same please do let me know, it will be helpful.
(Also I have posted another query which is related to the same use case if you guys can have a look it will help: SubQuery)
Regards,
Sidhant