Firebase vs Lists & Listview?

Well, not quite the same at all...

Look again at my structure, and the top node which is aquarium (this is set as projectBucket)

To populate your display, you need to call back the tag for the selected value (create a spinner or use a popup menu extension for this).

Then you would send your get value:
e.g. as in my example
getValue: salinity

which will return all the values in the tag salinity. You would then need to process the returned json (make human readable dates from timestamps/ get the value for each) for displaying in a list.

I do not see a getValue in your example?
This is my data format.
I just added a spinner to the top of the screen. For now I am using an entered list of elements.

image


image

I setup a spinner from your tutorial.
Now I am trying to populate the rows of data. I thought I would at least get the first row with data from the getValue.

I suggest you have a look at the contents of value returned in gotValue. Add it to a label to see it .

For me, when calling alkalinity, I get a json with two sets of data (which is all there is):

{"1720704449864":"\"4\"","1720704846242":"\"4.08\""}

image

why would I add value to label vs text box?
how can I look at the json?
in C or cobol I would debug with lots of print statements to visualize what is happening

When the spinner selection (spParameter) is picked, get the tag for starting recalling the data. Do I need to refocus the pocket?

I try to break the parse the key but sure I need to be working with dictionary? (trying to follow you post on another thread - How do you display data from firebase? - MIT App Inventor Help - MIT App Inventor Community

1 Like

Those spinner options hang off the root of the data tree, so you should set the bucket to the empty string before reading a tag.

You don't know what the previous actions might have left in the bucket, so you force it.

If you re-organise your firebase structure as I suggested, and use a label instead of textboxes, you can do this:

image

There should be no need to change the project bucket, just use the tag/s supplied from the spinner.

Is Label1 the selection of which type?
The Label2 is the display area for the bottom of the screen? If the database has more data then will fit on screen?

When I do your code and data structure - I am not getting the lower data, I am just getting {} reply

I followed your database structure
Data structure

And your blocks code

but I am not getting any data on the screen

You are calling for a tag "Salinity" (SentenceCase). You only have a tag called "salinity" (lowercase)...

Changed the code to correct case.
The screen is showing {}

fbdatabase

Do you have all your tags, e.g. Salinity, pH, etc., inside a projectBucket? Is that the same as the projectBucket set in your app?

I do not know. I do not understand how the projectBucket works?

Go back to here:

image

and also read my subsequent posts

Thank you.
I just went to the library to get a App Inventor book but it does not even mention Project Bucket. All the examples in the book are creating Chat, photos and a bouncing ball app.
Should I just change to Visual Studio or something different.

I am going to go back to the beginning of this topic and repeat step by step.

I have the "last" tag piece and if I press the "Recent" button, I can fill the first screen. The button to clear the first screen works.

The Data or History button is where I am stuck. I want it to select which parameter (could be 8 different buttons, or a spinner). Then under that, fill the screen with rows of prior values saved, showing date,time, value. At this point, I believe my issue is I am getting the "Parent" level -Salinity which does not have a value. Under it, are the rows of data (date, time, value). How in blocks do I step down that level? Should I change the structure to have parameter & date & time as the tag or key?

When you say "can of course call back the whole lot" - this is what I am trying to do. Perhaps then filter it?

TIMAI2, would I be better to not use anything in projectBucket? I have been reading other topics that talk about projectBucket and in several you suggest it can be left blank, but if done so, it needs to be blank everywhere?