Firebase, execution order for each item in TagList

This is my first post so I want to welcome everyone.
I'm having trouble getting ProjectBucket from a loop. I always get the last element from the loop. Here's a sample of the code with this problem:


The structure of my firebase is as follows:

I would like to get an ID by Name
Requests help me figure out how to get this information.

Don't issue all your .GetValue calls in a loop all at once.

Instead keep a global queue (list) TagList of the tags you got back from the .TagList result, and issue a .GetValue for just for item 1 of that list.

In your .GotValue event, you know that the tag/value is for item 1 of the TagList result queue.
If the name matches, show the item 1 of the Taglist global variable list (the ID) and clear the list.
Otherwise, remove item 1 from the Taglist global queue and ask for the new item 1 (if not empty).

Alternatively, if you control the structure of the Firebase DB, add an extra branch to the tree with name leading to ID, redundantly, at the cost of extra logic and maintenance.

Another idea is to read the entire database into a single dictionary at startup in just one call, and search that locally. That depends on how frequently your data changes.