Is it possible to delete a list of uploaded files as a workflow action?

Hi All,

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.

image

Cheers!

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).


Dan (creator of LearnTo - 15+ hours of Bubble tutorials and live coaching)

7 Likes

Much appreciated for the concise video there. Cheers.

1 Like

Hi @dan1 and @luke2 ,

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.

Does that make sense?

Thanks

Hey @mangooly

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?