Shortcut to remove files from folder

I have a shortcut that takes a picture of a return ticket from the postoffice, and saves it to a /shortcuts/ticket/ folder on iCloud drive. (f.e. return receipts for items returned to online stores)
files are names yyyymmdd-receipt-for-storexxx.jpeg

What I’d like to add is a separate shortcut that is able to retrieve a file list, and delete the files I no longer need. So basically: retrieve file list -> sort list by name -> multi select entries -> delete selected entry files from the folder.

Does anyone know how to do this?

See if this example helps.

Your filtering might need to be a little more sophisticated, but it depends upon what else you have in your folder as to how you can rule them out. It may be easy to do just with a filter files, or you may need to loop through all the files and use some regex against their names to build a new list of files and then process that list for deletion.

Hope that helps.

Thanks @sylumer! It was the “repeat for each” that gave me the jump I needed to find the solution.