How do you create two lists: Tags and Subtags?

I am making an app using Firebase DB. I have a name of the subject, inside there are names of students, inside names of students there are their notes with tags (numbers).

I want to display notes like this: "Name of the person": "Note"("note's tag") (As I have several students I need to dispalay all their notes)

I need to create two lists. One with names of students, another with tags for their notes. I can't find a way to do it. Can anyone, please, help?

Here is a suggested database structure:

subjects
  NoClueidianGeometry
     students
        ABG
            notes:["room1202 Mondays 10 AM","Buy book NoClueidianGeometry","trip to Flatland Tuesday"]
       Anton_Grebinnyi
             notes:["room1202 Mondays 10 AM","Buy book NoClueidianGeometry","trip to Flatland Tuesday"]

You can set your Bucket to subjects, and ask for a taglist to get all subject names, and ask for a branch of the tree by text JOINing the path to a twig, separating the choices with / ...


(from another Firebase project of mine)

The tag for ABG notes might be:
subjects/NoClueidianGeometry/students/ABG/notes
and the value should be a list of ABG's notes.

Initial setup of the students should be done via a StoreValue of an empty list (create empty list) at the notes tag for each student, and subsequent notes additions by each student should be done via a FireBase AppendValue block, to maintain list structure.
This keeps each student's notes in chronological order, since they are each added at the end of their list one by one.

This is a good time to study dictionaries, in case you want to experiment with retrieving intermediate branches of the data tree.

1 Like