Just a quick question, could be a feature idea/request, but I am setting up an API endpoint to run recursively clearing up deleted photos users have uploaded, but later trashed. Anyhow, just wondering if there is a way to run the ‘Delete an uploaded file’ on a list of files in one action, rather than just a single item at a time.
Essential I’m after ‘Delete a list of uploaded files’ if it exists in some form or workaround?
I have a workaround on the endpoint so it all works & loops correctly, but would be nice to neatly contain in a fluid workflow set.
You can set this up as an API workflow on a list of files. The quick video below (no audio) will show you how to set up an API workflow to do it. (Just remember that you need to be on a paid plan to run API workflows).
I’m using this idea to delete orphaned files created with the file uploader. If a user uploads a file and then another and so and decides to stick with the 3 uploaded file there will end being 2 orphaned files.
My idea is to setup an API workflow on a list like you have done in your idea. Although I don’t know how to make sure the API workflow does not delete the file that the user has decided to keep.
Sure if you send over some screenshots I can probably better advise, but essentially you can use the :sorting expression (by creation date) combined with the :minus item or :minus-list depending on the use case.
Are you scheduling in real-time? e.g. current date or in the future?