Firebase and numeric data

Hi, I'm new user about Mit Inventor and Firebase and I need only a suggestion.
When I write a numeric data from Mit into Firebase, the data is store inside two "" (i.e. "999") like a string data.
Instead, when I write a numeric data from Arduino or from esp32 into a Firebase, the data is store in numeric format (i.e. 999).
If I read a data store in numeric format into a Mit Application, I've a database error.
I could transform the numeric value into a string value, before write from Arduino, but I think I miss something.
Than you for your help,

I can confirm your observation:
before update room of AI2 course
The update block:

after update room of AI2 course

As you noted, the 1303 changed to "1202" .


Temporarily read it into a Label component - perhaps it is not just a string representing a number (Which App Inventor automatically recognises as a number) - perhaps it arrives in quotes or there is a space char - once you know, you can remove the offender(s) before passing the value on to the Block that needs a number format.

You can overcome this using AI2 if you use the webcomponent and the firebase REST API.

This will allow you to store numeric values on firebase without quotes. Ai2 will/should return either....

Thak you for your help.
I solved the problem in a simple way; first, I transform the numeric data into a String data with " before and after, then I pass to the Mit the String and everyhing worked fine.


1 Like

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