The only way to delete a list of files from the file manager programmatically is to use a recursive backend workflow as the only workflow available for deleting files from file manager allows to only remove one file at a time.
There should be a new workflow action to delete a list of files from the file manager the same way there is a workflow to delete a list of custom data types form the database.
If we are forced into using recursive backend workflows to delete a list of files from the file manager we are being forced into paying more than we should have to for the function as now with new pricing of WFUs each time we schedule a backend workflow we are charged, so a recursive backend workflow that will delete a list of 10 files will be charged an exponential amount more than what it should be since we would have to schedule the backend workflow 9 times as well as run the workflow action to delete the file 10 times, instead of a simple delete list of files workflow action that could be done on the page and be a single workflow action.
@josh@nickc Please ensure things like this are added into the editor when adding the numerous features necessary to allow us to develop optimally within the new pricing structure. Little things like this will go a long way.
To add into this…there should be a way to select in a workflow action of delete a thing, to delete any uploaded files attached to the thing…this way we do not need to run a workflow action to delete the uploaded file of the thing to delete before deleting the thing.
In relation to the first post as well, if there is a list of things that have uploaded files, we are currently forced into running a recursive workflow to delete each thing as well as the uploaded file of each thing, making it even more abusive of WUs to delete things and uploaded files.
For example, I have a list of things, about half of which have the data field for image filled, so instead of being able to delete a list of things, I have to set up a recursive backend workflow to first, delete the upload image file from file manager if the thing has the image field filled, then run a workflow action to delete the thing itself…
it should be possible to do all of this in one single workflow action that would be ‘delete a list of things’ with a checkbox to delete all attached files of each thing.
There are ways to do that like through the API or the CSV upload function. But, if you have an idea of the implementation and how that would look like to the developer in the editor, post the idea to the idea board and/or make a thread about it to help Bubble see what the community is requesting for features to improve the platform within the new WUs model.
What I ended up doing for now is to filter my list when scheduling the backend workflow to filter two lists…one of things with an image and one of things without an image. On those without an image I run delete list of things and then for those with image I have to run the recursive workflow.
I ended up doing that because the recursive was taking too long and was having issues of data not getting deleted if I ran it multiple times successively…seems like the reliability of recursive workflows is gone now (I had not had issues with recursive workflows like this prior to WUs introduction)
Overall, my goals are to make it so that I do not need to use external services and can get done within Bubble WUs confines what I need to for as little WUs as possible.