How to make TextBox to be integer data not string data?

Hello im new here,

How send integer data (from textbox) not string data to firebase server and end up in ESP32?
because in my ESP32, there’s not a integer data just only string data.

This my ESP32 receive string data from firebase and kodular = Screenshot by Lightshot
This my ESP32 not receive a int data from firebase and kodular = Screenshot by Lightshot
This is my block in kodular = Screenshot by Lightshot

Thank you

Try textbox input type to Integer or phone number

Yes it would work.

input type is this Screenshot by Lightshot or on the block section ??
if yes, i change the input type and still not detected a int data

May you please elaborate me what do you mean by detecting

Hi,

You can use this guide to learn how to upload blocks to the community. This way they are visible immediately instead of that you have to click on links.

1 Like

Oh sorry i mean receive not detecting.
on my esp32 which is connected to firebase, it does not receive int data, if the program on my esp32 changes by receive string data it will automatically be detected on my esp32.

my block

Is your ESP32 connection is correct with you Firebase?

1 Like

yup, its correct, and just receive a int data, if in firebase not had a int data, there no data in my serial monitor. but if i change to only receive string data, the data will be in my serial monitor.
Screenshot_68

In my impression, The store value block will store a string value to firebase.(Whether the value it is text or numbers)

So, you need to change the arduino code to getString() maybe it work.

1 Like

yup you right, and remove some text from firebase and you can convert it into integer.
the data from firebase have *data*, so just remove * using string.remove and convert it with toInt.

1 Like

You also can getString() & convert it toInt().

yup, that i do right now, if kodular can’t make data to be int, you can convert it in esp32.

1 Like

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