Checkbox e TinyDB

If I have two checkbox
[ ] Yea
[ ] No

How to save in tinyDB only what user can choose?
I tried this, it’s saving both checkboxes, the chosen one and the empty one.

Screenshot_1

blocks

Instead of using like this, why don’t you use global variable to catch and use it here.

I mean, when check box 1 checked

Set variable 1 to get check box value

1 Like

But i feel it works fine with your blocks. It accepts only what we suggest

  1. No checked the box
  2. checked box1
  3. checked box1 and 2
  4. check box 1,2 &3. See the entries

May be i am worng… If you set empty text box, it will will store like that only

1 Like

Yes, you can try like this it accepts only checked item

Do It Result: {"1":[],"2":["Box1"],"3":["Box2"],"4":["Box3"],"5":["Box1","Box2"],"6":["Box2","Box3"],"7":["Box1","Box2","Box3"]}

1 Like

Thanks @Still-learning for the help

1 Like

@Still-learning @Douglas_Maueski
Why not use When Any Checkbox.Changed event? :thinking:
An alternate way below :point_down:

Also @Douglas_Maueski as mentioned below the marked blocks are used to remove the selection from the list if user unchecks the box before saving the selection. You can remove the blocks if you want

AIA file :point_down: if needed
CheckedTextBoxEntries.aia (3.2 KB)

2 Likes

Yeah possible… but the fact is,i tried with limited events and blocks

1 Like

Sorry but I didn’t get you. I have just used the available events created for that specific purpose for example directly using when any Checkbox.Checked instead of creating a list of all check-boxes and then looping through them to validate if they are checked or not and I think, using the mentioned event instead of loop would be more optimises way to do current task

1 Like

Thank you for your help. @Vaibhav

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