Possible to switch multiple toggles at the same time? - (topic 2)

This topic is based on what has been discussed in the one pasted above.

@jean-emmanuel, you suggested this code in the third post:

// setting multiple widgets from a single script
set("widget_a", 1)
set("widget_b", 0)
set("widget_c", 1)
// etc

How would you proceed in this case? (see the code below)

// WHEN THE TOGGLE BUTTON IS ON:
set("solo_push_1", 127)
set("solo_push_2", 127)

// WHEN THE TOGGLE BUTTON IS OFF:
set("solo_push_1", 1)
set("solo_push_2", 1)

Thank you!

You can use the toggle's value in its script property to write conditional statements:

if (value === 1) {
  // do something
} else {
  // do something else
}
1 Like