How do you nest sub Databases using FirebaseDB?

This is how I envisage my DB layout. I tried using project bucket that did not work. The whole idea is any user should be able to browse the request or the donation they have made with one click. Suppose user1 wants to see the requests made then the app should go in RequestDB/User1/ and dump all the requests made. Single level nestle works I could not create multiple levels. The question is can we have a Tag: RequestDB/User1/Req1. If so kindly show how one can create such nestled DB layout and how one can read it back. Thanks
FirebaseDB1
RequestDB:

            User1:
                     Req1: "[..................................]"
                     Req2: "[..................................]"
                     Req3: "[..................................]"
                                  ....................................
            User2:
                     Req1: "[..................................]"
                     Req2: "[..................................]"
                     Req3: "[..................................]"
                                  ....................................
                     ......................................................
    DonorDB:

            User1:
                     Don1: "[..................................]"
                     Don2: "[..................................]"
                     Don3: "[..................................]"
                                  ....................................
            User2:
                     Don1: "[..................................]"
                     Don2: "[..................................]"
                     Don3: "[..................................]"
                                  ....................................
                     ......................................................
    UserDB
            User1: "[..................................]"
            User2: "[..................................]"
            User3: "[..................................]"
            ......................................................

You just wrote it !

Calling a tag: RequestDB/User1/Req1 will return the value of Req1

Calling a tag: RequestDB/User1 will return all the Req* and their values as a JSON.

image

Similarly

image

1 Like

You can JOIN keys with slashes (/) to build a Firebase tree structure, like in this bus route tutorial
https://rominirani.com/tutorial-mit-app-inventor-firebase-4be95051c325
from

2 Likes

Two follow up question please. One question is curiosity for future and another for now. My database looks like this:

I run this program

  1. Here since it is just 1 level deep I get the tag names under RequestDB and it works fine for me. What if it is multiple level. Is there a way to call GetTaglist multiple times?
  2. I want display the JSON strings. I tried JsonTextDecode and one with the Dictionary and with list set to Elements and Elements from String. None of the combination worked. The one shown is the best so far.
    As an example, what I expect under ananda is like this:
    image
    Please advice and thanks for the previous help too. Later on I did try "make a List" before passing it to the Listview and I also tried writing the JSON decode value to a Text box and a Label none of them worked as desired. I even tried using a Dictionary too. :slight_smile:

See this topic for ideas

https://community.appinventor.mit.edu/t/json-doesnt-work-correctly-with-my-blocks/56144/5