Click checkbox to add, uncheck checkbox to minus

I have a total and I have a list of numbers. If I click a check box next to the number, I want to add this to the total.
I can do this with variables, but if I click the checkbox again it keeps adding to the total.
How can I set it so that when I uncheck the checkbox the number is subtracted from the total?

Hi @James_Willoughby

You can achieve this by creating a checkbox component and add the logic to this component. When the checkbox is unchecked and it gets clicked, you add one to the count and change the variant to “checked”.

On this variant add the following behaviour: when the checked checkbox is clicked, subtract one from count and change the variant to “unchecked”.


Bloody hell, I was way overcomplicating that, thanks!!

1 Like