App Inventor working with Firebase database

I apologize in advance if this is for the wrong Firebase flavor:

1 Like

I am working on three problems:

  1. the data in the firebase database "appears" different if I use MIT APP to write record or manually type into the Firebase web screen. See image, some values have quotes, others do not?

Problem 2 -perhaps design issue. The APP hopefully will "open" with the most recent data from the Firebase data showing. For now I am trying to add a button that populates the screen with the most recent values. A button on the screen "Recent" will call the attached blocks but it is not retrieving the data but showing the tag in the text box . My blocks -
Repaint screen

Problem 3 - When I click "Update", I am writing the data to the database and then wanting to write a copy to a parrallel projectbucket, that can overwrite the prior entry, the purpose is to keep the last TAG used for faster recall and loading the screen. The projectbucket "SalinityLast" should only keep one piece of data -the TAG for the last entry made into the projectbucket "Salinity". See my blocks. I am thinking I need to be using not StoreValue but Change or Append?

If you want to get rid of all the double quotes - " - then use the web component to interact with Firebase

Will the double quotes impact the way the app functions? My goal for the project is to have arduino load some data into the firebase and the MIT App to load some data into the database. I do not plan to manually add data to the database via the web interface. I was thinking I need to use the NumbersOnly or other setting?

I suggest you first just try it as you are, and see if you have any data issues when returning the values to your app.

Repaint screen

If you want to retrieve what is under tag SalinityLast in Button5, you would have to first temporarily set your ProjectBucket to the empty string, the top of the tag tree.

The incoming value for tag SalinityLast would then be a dictionary with key a datetime string and a subvalue of the salinity.

When I write into the database with tag of Salinity, I want to write an entry under SalinityLast but it does not need to be a new entry in SalinityLast but overwrite or replace the exisiting. SalinityLast should only have one record under it and it will be the last tag used. Do I first delete the record or can I write over?

Here's the sequence to write SalinityLast:

  • set bucket to empty text block
  • store at tag 'SalinityLast' value Textbox7.Text

THANK YOU...that worked

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.