Saving and retrieving checkbox inputs

I've done this and it has worked! Thank you.

Now however (and I should have mentioned this before) I have a number of different check box lists and for some reason in some of them when I change one list it is changing the checkboxes in a different list but in the corresponding checkbox e.g. 5th and 5th, 9th and 9th.

Is there a way to fix this or have I been too ambitious by replicating the any checkbox function? I have checked and they look as though they are pulling the info from the relevant TinyDB.

Show us your new blocks.

Will do when at home. Also when I build the app and scan the QR code and download it to my phone hardly any of it is there. Works perfectly on the companion.

image


This works exactly as I want it to!

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