Many buttons manage

I have this directory: items { "one": {"units": " ", "colored": "not"}, "two": {"units": " ", "colored": "yes"}, "three": {"units": " ", "colored": "yes", ...}

each item has a button. When that button is clicked, unit might be incremented. If "colored": "yes" user is asked for a color. If user introduces one, a new key {"color": "anycolor"} will be added.

How can I write a procedure to process button.click´s

You can use Any Button component, show please your blocks

1 Like

I am still building them. I´m trying a conditional "if dictionary{"keyX": true] then ", but I don't know how to insert that condition to "if" block

And need to put boolean false block for or if not found socket, because will cause truble if keyX not found in dictionary.

Not strictly necessaary :wink:

Maybe, but when I did Do It it executed the true block, that is not expected.

With TinyDB as well,

This is one of those false=true AI2 paradoxes :wink:

Ohh, mean already known setting/arrangement, but mystifying.

Thank you I´ll try

Thank you i´ll try it

Sorry, I don't understand.
with "et value for key "keyX" I am asking for a value ougth to be there. but "in dictionary make a dictionary {"keyX": true, "keyY": false}" I am just creating it (supossed being before).

May be I need a tutorial about dictionaries. Do you know anyone i can read?, please.