Forum Discussion

SarahFlynn's avatar
SarahFlynn
Community Member
2 years ago

Adding and subtracting variable count in a radial button set

Hi all, I have a series of three radial buttons in a set. I have set a variable to add a value depending on which button is selected. My problem is I need them to be able to select a different radial button in the set if they change their mind, so the variable needs to adjust accordingly. For example, if they select the first radial in the button set, it adds a value of three to the variable. If they select the second radial, it adds a value of four. So if they select the first radial, then change their mind and decide to select the second radial instead, is there a way to subtract three, then add four to the variable based on the change in selection?

Thanks!

  • an idea:

    • Create a variable for the choice which can be 1, 2, or 3 based on the radial button.
    • Add the respective number when selected.
    • The challenge as you note, is that if I select 1, then the value is one. If I decide to select 2, then it would add two so the value of the variable is now 3.
    • You can put a trigger that zeros out the var and then adds the new one. One way is to subtract the value of the variable before adding the value to the variable.
  • Do they press a submit button? If yes then add the maths to the submit button based on the state.

    OR Add the calculation to a layer e.g.

    Set variable to 0

    Add 1 if 1 selected

    Add 2 if 2 selected

    Add three if 3 selected.

    Then add a trigger to show layer on each radio button

  • SarahFlynn's avatar
    SarahFlynn
    Community Member

    That tutorial is awesome, thank you so much for the file, it does exactly what I need it to. And great idea about the submit button tie-in!

    Y'all are great. Thanks. :)