Checkbox states

Hi everyone,
I think I understand why I’m stuck: in WeWeb, the checked state of a checkbox is only visual.

When I add a workflow on the checkbox (on click / on change), it always runs the same workflow, whether the checkbox is being checked or unchecked.
So I don’t see how I can have two different behaviors (add to array vs remove from array) based on the checkbox state.

What I want is:

  • If the checkbox becomes checked → add children to variable

  • If it becomes unchecked → remove children from variable

But since the checkbox state doesn’t seem to drive the workflow logic, I’m not sure how to create a real toggle behavior instead of just a visual state.

How do you handle this in WeWeb?

Thanks a lot :folded_hands:

Hi @Noamsrx :waving_hand:

One way you could do this is to:

  • add a workflow to the checkbox
  • trigger it `On change` of the checkbox
  • use a true/false split to check if the checkbox value is true or false
  • configure the change variable action differently in the `true` and `false` branches

Does that help?