Saving and retrieving checkbox inputs

I'm sorry but I'm just starting out.

I'm creating a basic app to keep track of what rides my family have been on when we visit a theme park.

I have a check list of 9 rides. When I leave the screen or app I want those that have been checked to still be checked. I've tried various methods using TinyDB but it isn't working. I think I need to duplicate the check box tags but I'm getting a bit lost and would appreciate some help. I'm sure it is really simple....sorry

Please show your relevant blocks (how you saving and retrieving from tinydb) and screen layout

I've actually been looking at a previous solution you gave somebody back in 2018 I think.

To be honest I have started again.

image

OK, so that stores the checked value of Backlot to tinydb. How you do set the checked value of Backlot when you reopen the app ?

image

Do I have to recreate this for all 9 checkboxes? Can I not do it for all checkboxes e.g. if any saved checkbox is ticked then tick that checkbox?

  1. That is just the store value again. You need to set the checkbox to the saved checked value when the screen initialises.

  2. You can use lists and the any component blocks to iterate over each value, so no, you don't have to repeat 9 times. We are working on understanding the process for just one right now!

This would be what @TIMAI2 explained:

Thanks @Italo :wink:

1 Like

This looks great but in the make list I can only add two lists. How do I add more?

Sorry I'm sure this is all really basic stuff.

https://appinventor.mit.edu/explore/ai2/support/concepts/mutators

Click on the mutator (the little dark blue square) on the make a list block to add more sockets

1 Like

And I'm sure you will need to know how to retrieve the values of those checkboxes the next time you open the app, so this is how:

image

Since you are learning I think it will be useful for you to go block by block and ask here what you don't understand. I don't want to just give you a bunch of blocks that you don't know what they do. So please follow the logic in the blocks provided and don't be afraid to ask.

Thank you so much and for pre-empting my next question. I think I understand it as I'm doing it, I can make sense of what you have shown me which is amazing. I just couldn't do it myself but thank you!!!

1 Like

This is everything I have including a basic function to go to a different screen when the back button is pressed.

Can you see if I have done anything wrong as it isn't working when I try it on the AI Companion

Thanks
image
image
image

it depends how you switch screens...
see also chapter "Some Notes" here App Inventor Tutorials and Examples: Manager Screen | Pura Vida Apps

Taifun

I just pressed the back button

switch screens correctly and read the notes

The recommended method of switching screens in App Inventor

Taifun

When I press the back button it goes where I want it to go with no issues or error messages but when I click back in to the screen the check boxes aren't ticked.

I appreciate I may have not shown much patience. Perhaps I should do multiple blocks rather than all check boxes but I need to understand why what I have put in doesn't work.

I've read the notes and still struggling!

Try fixing this: That block is not the correct block.

image