I want to be able to delete all records, created in appgyver database with clicking on one trash icon. Is this possible?
Yes, it’s possible to create such logic. But not with just one call to backend. You need to create logic that loops through all records in the database and deletes those one-by-one.
- First use Get record collection to get all records in the database and save those IDs to a variable (e.g. Page variable)
- Then use Delete record with ID from the just saved (Page) variable (e.g. PICK_ITEM(pageVars.all_ids, 0)
- Then Set (page) variable again, but without the ID that was just deleted (Formula WITHOUT_ITEM should work well)
- Then use If condition to check if the (Page) variable isn’t empty yet
- If it’s not empty, loop back to the same Delete record which will now select another ID of a resource to be deleted from backend
This loop should continue until it has looped through all records in the database
thanks for your answer. I am also looking for exactly this delete function.
As new user, it is not easy to understand.
Is it possible to do a very easy video of what you wrote? Because i really dont know, where to put the “pick_item” and other things into:… sorry for being fool but on the one hand appgyver is really easy and on the other side you expact learning “appgyver language”
It also depends how your data is stored. Firebase stores data in a tree structure, so Deleting a top Node will delete everything below it. You could effectively delete the entire database with just 1 Delete call to the top-most Node
I’m using the AppGyver database. I don’t know how it is stored. I will try the thing that Tomi_Laakso wrote.
I’ve got some error.
PICK_ITEM(pageVars.UsernameDeletion, 0) shows this error:
Object Type is not assignable to text type
And what do i have to write into the item part of this?
Hast du es zum Laufen bekommen?
No, we’ll need to wait for an answer.