I want to call the tags of the sub-items of the tag and list the desired values among the loaded data

Hi, I want to load the tags when I first run the app, put them in the spinner item, and load the tags included in the selected spinner item. And I'm going to get all the values and make it a list.

image !
for example, Let's see the data stored in the firebase.
The first time you run the app, Busan,area1,area2 appears as an item in the spinner.
I have completed this step.
However, if I choose area1, I would like to recall the sub-sections of area1,2,3,4.
And I want to make a list of all the values of the "date" through the dictionary among the data I have imported.

Please show your relevant blocks. How are handling the data when it is returned to the app ?

Here is the block image :frowning:

Something like this:

image

image

  • My top project bucket is called Areas
  • You get the taglist in Areas
  • Select a subtag from that list (Area1,Area2,Area3,Area4)
  • Content for all sub-subtags in selected tag are returned
  • Dates for each sub-subtag put into list

You do not need a second firebase component for this. You need a web component for the JSON Text Decode block
Note the work on the spinner to enable selections see here:

Thank you. It worked out thanks to you.
But I have a question.
I saved the data in the same form as the data stored in your firebase. I set the index to 4 because I wanted to get the number value, not the date. But there was an error. By setting index back to 2 and keypath to number, the desired value could be obtained. So I wonder what the index's value means here.

!(upload://aKcKl31BYdLDe6yZr7Z95KVnR3c.png)
!
And I added a little longer data to the firebase. However, the above error appeared when the item was selected. What is the reason? Please Help me.... :cry:

The data in the tag "busan" in the firebase is as follows.
"{"date":"06\/28\/2021","land use":"Field\/ Cropped area","sample number":"1","Investigation status":"1","worker":"dawon","lat":126.98930333333334,"lon":37.551555,"area":"Field\/ Cropped area","BAT":"16 :45 :37","MST":"16 :45 :37","MCT":"16 :45 :52","DTT":"Text for Label4","Preprocessing time":"Text for Label4","Measurement time":"Text for Label4","Data transfer time ":"Text for Label4","Cu":"","Pb":"111","Cu state":"1","Pb state":"1"}"

1 Like

Here
image

and here
image

you try to select an item at index 3, but the Busan tag contains only 2 tag-values.
In this loop

and in this loop

only two values will be added to variables dates and numbers respectively. (In case of Busan)

So when it doesnt find a third value while setting text for label6, it returns an error.

image !
The top two blocks you mentioned are to load the 2nd and 3rd values from the previously loaded lists of dates and numbers into their respective labs.
In the data type of firebase stored by TIMAI2, if Area2 is selected, "71", "29", "3" are stored in the numbers list. And among them, the first value 71 is stored in Lable22, 29 is Lable 23, and 3 is stored in Lalbe25.
My problem is that when the data stored in firebase becomes long, an error like the image occurs.


I wonder if the index value should be changed according to the number of tags to get rid of this error. If so, is it possible to flexibly bring data regardless of the number of tags?

That's something I mentioed in my post :slight_smile:

It is possible, but I can't give you the blocks right now...
But surely something to start with -
Create a list of label 4,5 and 6.
Again use a for loop with the list being dates.
Use the label's list in the for loop and set their text.


I hope you understood what to do.