How to purge a dataset

I’m trying to reset the data in a datatype.
My intention is to delete everything and then upload the new data from a CSV file.

I’ve tried running backend workflows to delete a list of things (until #500) and then schedule it to repeat the API workflow every 5 mins until the thing:count is zero.

Unfortunately, this won’t work. I’ve spent hours, refreshing and trying to delete the files.
Any advice would be greatly appreciated. Cheers

Why didn’t it work (what do you mean it didn’t work?)… did nothing happen? Or it timed out?.. How many entries are there in the DB?

I’ve spent hours, refreshing and trying to delete the files.

Are you trying to delete files? Or things in the database?

I’m trying to delete things. I want to purge the entire dataset.
I had over 28000 things and I realise that bubble struggles with lists over 10,000. So I’m clearing the list and only uploading the important items that are required (<10,000).

The backend API is deleting a list.
image

In this step, I’ve limited the list to the first 500 items.
I’ve tried different quantities (100, 200, 500, 1000).
image

The last step loops back through the workflow until all items are deleted.
image

The whole process is triggered from a button on the front end.

Am I doing something wrong?
I’m using similar workflows in my app, but not having this kind of trouble.

Hard to say… but I wouldn’t do the initial search on the front end, so I’d move that to the backend and see if that helps…

Maybe just try deleting one thing at a time instead of 500 as well (no need to wait 5 minutes between runs)…

1 Like

Thanks Adam. I tried that and it crashed after deleting 154 items.

What worked for me in the end was to take your idea and break it up into multiple steps before scheduling the workflow again.

I don’t know if 20 steps was necessary, but it worked when I tried it :partying_face:

1 Like