Firebase getTagList from a list

This is probably related to a Firebase parameter called the Bucket.
It is intended to give you a starting point in the Firebase data tree when you don't want all of it, but just a small branch of the tree.

From your data dump, I see there are several layers to your tree, so you probably need to have your Bucket pointing deep into the tree.

It has been a while since I did Firebase, but I am guessing there might be one of two ways to point the Bucket deep into the tree:

  • set the Bucket to the first layer (the top), then set it to that long garbage string, then set it to Yago if you just want Yago, or
  • set the Bucket to all the branch choices on your way down, JOINed together with '/' between each layer and the next. ('/' is special in Firebase and CloudDB, as I recall.)

Maybe some one who has used FireBase recently can remind me?

1 Like

Wouldn't be easier, in case there are no authentication rules in firebase, to use Web component to get all data from firebase ?

We can set Web1.Url to

https://<PROJECTID>.firebaseio.com/.json?

and then when Web1.GotText we get responce content in json format. Afterwards dictionary blocks can be used and lists can be created according to needs

1 Like

Thanks ABG! I'll try to do that. I noticed that even when I changed the index on the blocks, when I hit the read button, it gets the entire data from the UI. Maybe we need to cut the bucket somewhere and split the data. Thank you very much man!

This app is still in Test Version, till we finish it. When everything works well I will change the rules and authentication. I am depending on this app to continue in my first job as a developer. I know that I still need to learn tons of things,work on my logic, my codes. And all the times I needed, the community was there to save my skin! Just want to thank all of you! :smiley:

1 Like

Ouch!
(reverberations of decades-old remorse)

1 Like

Also note that when tag list contains only integers like 1, 2, 3… Get tag list block will not work properly

1 Like

So what do you propose me to do?
:thinking:

Stay cool! In the end everything is gonna be alright! :sweat_smile:

Do a small side project to learn how to navigate your ProjectBucket in the data tree.

Search this forum's samples section for working Firebase samples.

1 Like

I think this is the best think to do now! I'll do that!


from
https://sites.google.com/view/metricrat-ai2/guides/firebase-chat-label-html-content

shows the JOIN with / method of bucket navigation.

1 Like

Let's see if it works! Thanks :+1:

Hey, it's me (Goku) ! :sweat_smile: (Again)
Does anybody got an idea to continue this "for each" block? I'd like to continue Tim's CRUD Tutorial. How can a make the spinner's choice to set a list in a listpicker?My spinner has the items: Name, Email and document number. Since "Name" receives number 0 index, how can I make spinner to get all indexes 0 from all the costumers? I don't know if you can understand what I am trying to say! Follow the pics!

blocks db

What is in the list you are traversing?
Is there another list matching it index number by index number that you will need to access?

  • if so, use the other for each block, that uses index numbers.

No. This spinner is just working as a filter. They want me to build a well done search filter, cause we are going to work with clients from different places, from different companies. I made a sketch from the screen. After we choose the filter "by name" in the spinner the listpicker will display a list with just the names, according to firebase list name is index 0 from clients. I would like to get all the indexes 0 from clients and display on that empty listpicker, so than we can choose the client there, and when we do so, hitting on the costumer's name, we get all the other data from the chosen costumer to fill the blank textboxes corresponding to each information. But if you think there's an easier way to make it I would be quite happy to hear it! hehe

I made a block similar to one of the blocks I saw in a tutorial, and I got an error. But somehow the spinner is almost doing what we need.

db001

I am having trouble keeping track of which is major and which is minor between client and costumer (customer? or some one who sells or makes costumes?)

So Yago is a customer, and his clients are Joaquim da Silva and Maria de Lourdes?

1 Like

Yes! It can be this way!

In fact the users are going to be glaziers (I think this is how we call the guy that install windows on buildings,correct me if I'm wrong!) and they're going to register their clients, in this case Yago(me) is a glazier and Joaquim and Maria are my clients.

Here is an experiment to try.

In your .GotTaglist event, take your ProjectBucket value from the FireBaseDB component, and split it at '/' into a temporary list. Take the length of list of the temporary list, and use it in an if/then/elseif tree:

if length of list = 1, you asked for all the top level names (Yago,...) so you can use the taglist to fill your list of customer.
if length of list = 2, you asked for everything under one of your customers (ProjectBucket=longGarbage/Yago) and you got a big mess, else
if length of list = 3 and item 3 = "clientes" then you asked for the client names of one particular customer (ProjectBucket=longGarbage/Yago/clientes) and it will return the list (Joaquim da Silva, Maria de Lourdes,...)

The length of list I used above can be considered the depth in the tree branches of your request

Similarly, in your FireBase .GotData event, check the depth of the ProjectBucket to see if you got details on one client (Bucket=longGarbage/Yago/clientes, tag = Maria d Lourdes (no slashes))

1 Like