How do I…
Clear out the incremental child number of an event.
What is the expected result
I expect to clic on a button, load a structure from firebase and display a 3x3 grid of some objects. Actually the code works, but only the first time. The second time i got always the same 6 objects displaying 
What is the actual result
I’m doing that :
The first time i click i have this result, as expected :
But the next time i have this (and nothing changed on the firebase) :
If i click again and again the colors changes, because firebase seem to sent me the fields in a random order, and the code always took the last child of the structure (even if the structure contains actually all different colors. I believe it’s an issue with the event “for each child of the structure”
… any idea ? I
I think it’s the delete and maybe waits. Weird things can happen when you delete objects and then add new ones with sub events of the delete. Objects aren’t deleted immediately and sometimes it has weird consequences.
Example, this works but if I move the delete to the button click event (making the add object a sub-event instead of being even) then it doesn’t work. I used an array of colors to test it.
There’s also an issue with wait. If you click too quickly, the delete actions will happen before the objects are added on the other clicks. You may want to disable the interactions and then re-enable with the last event.
Example Without wait
Click, delete, add objects
Click, delete, add objects
Example With wait
Click, delete, wait
Click, delete, wait
Wait from 1st click expires, add objects
Wait from 2nd click expires, add objects
You have multiple waits which add to it.
Hummm… i’d give it a try later.
Thanks for the headsup
1 Like
Amazing !
That was indeed the “Delete” action
i did like you mentioned and it work perfectly well, even if i don’t really understand why 
1 Like
I don’t always get it either. Usually what happens is the action uses the objects being deleted instead of the new one but I think this time it’s the delete in combination with the wait. I’m going to test it a bit more. See if it’s a bug.