Saving and retrieving checkbox inputs

image


This one is fine unless you go in to another check list (like the one below) and then whichever one you change, changes the other one.



You have at least two TinyDB components, RidesMagic and PrincessDB,
using the same tag scheme ChkBxnnn.

Examine the NameSpace attributes of the two TinyDbs in the Designer.

Have you changed the NameSpaces yet to send them into different XML files behind the scenes? Or do they still both point to TinyDB1.xml, sharing the same NameSpace?

1 Like

I knew it had to be something around that but was looking around the blocks rather than the NameSpace in Designer. THANK YOU!!!

Hi Can you tell me how to read data in this code but to work with Firebase? I can save data to Firebase but have no idea how to read it . Cant do that like here when screen initialize...




Last block is from TinyDb, can any one tell me how to change code to work with firebase?

Welcome Contial.

Here is a start. Firebase DB with App Inventor tutorial - #5 by Carl_Aydelotte



In text field etc i have no problem with obtain data from Firebase... only with this checkboxes

A guess is use a Text Block instead of a green Logic Block .... i.e. false in a red Text Block might work.

Experiment.

fbTag

It doesn't work either...
With Tiny DB it was easy, at startup screen auto load state of checkboxes. Now i need to do it with online DB and I have this problem from two days...

This code snippet works :slight_smile:
storecheckboxstate

It only stores the state of CheckBox1 and retrieves the value to a Label.

it may help you to debug your code.

1 Like

Yes but In my code there is a list of checkbox with value true if cheked and false if not. In Fire base I see tags eg. CheckBoxN11, CheckBoxN12 ...... with value "true" etc... But problem is with reading that . I messed up something with my code when i tried to change from TinyDB to Firebase :frowning:

Try
borrar_Check_Firebase.aia (2.8 KB)

1 Like

Great it works remember state of checkbox :slight_smile: but i have now an error in APP and AI:

The operation select list item cannot accept the arguments: , ["uwagi"], [1]
Note: You will not see another error reported for 5 seconds.

This is data from other fields that read from Firebase.

In your Firebase.GotValue event add an if statement like this

If tag = "checkbox"
Then continue with your current logic
Else add new logic for other tags

Taifun

Can you tell me where is my mistake ?

In your Firebase.GotValue event...
You like to execute the for each item in list loop only for tag = checkbox, don't you?

Taifun

Can you draw me at my blocks correct version ?

If tag = "checkboxN1"

Taifun

aahhhh OMG I am an idiot !!! :slight_smile: Thanks a loot :slight_smile: Works :slight_smile:
Can I have one more question? How to do that when I'm typing in TextBox and then press button to save it The cursor was not blinking all the time in TexBox ?

This is a completely different question. Please start a new thread for this. I will close this one.

Taifun