How do you convert string value to int value and store it in firebase?

How do I pass integer values to the firebase realtime database. i try to pass integer values from the MIT app inventor to firebase. But firebase always received string values. And i try to change Text to Numbersonly but it not working. Kindly help me for solving this problem.
image

1 Like

The best you can hope for, using the firebase component, is to do it like this:

image

If you really do not want any double quotes in your firebase data, then you would need to use the REST api and the web component to set data on Firebase

1 Like

I followed you but when importing from App and uploading to firebase it is still string data type
image
image

That is how it works (the firebase component), you could always use the x 1 block when the data comes back.

For number values, App Inventor will handle numbers as strings and string as numbers, therefore tthe storage of numbers as strings in firebase has no effect when using the data in your app. It is only when you want to use the data in a third party program that potential issues arise. If this is the case, then as I said, use the REST api and the web component:

1 Like

In case no one mentioned it yet, .NumbersOnly = true or false and lets the app control which keyboard (numeric or alpha) the Textbox pops up for input.

It only holds true or false, and not any numbers.

2 Likes