Limiting number of files in a folder in Onedrive

Highlighted
Occasional Visitor
How can we limit the maximum number of files per folder in Onedrive to say 10 files and any additional files being added will cause the oldest file from the folder to be deleted to add the new file in place so always 10 latest files are present?
3 Replies
Highlighted
There is not a setting in ODFB to limit the number of files to be stored in a folder
Highlighted

Agree with Juan there is nothing OOB.

You can try using powershell or Microsoft flow delete action and see if they can help.

Highlighted
Actually Flow idea is a great one that I would suggest to explore...it's clear that you will need something extra to check if the number of files in the folder is not the expected one and move files to another location...I would like to add to the possibilities mentioned by SPO Admin an Azure Function configured as Timer that monitors your folders. move files and generate some alerts about the moves done