Hi @nchandran ,
If you are strictly sticking to the toggle control with the combobox, you can try this:
In the OnSelect and OnChange properties of the combbox, type the following:
UpdateContext({ToggleReset:false});
If(
ComboBox1.Selected.Value = "Employee",
UpdateContext({ToggleDefault:true,ToggleReset:true}),
UpdateContext({ToggleDefault:false,ToggleReset:true})
)
*ComboBox1 is the name of the drop down control, you should change it to the name of your combobox.
Next, set the Default property of the toggle control to ToggleDefault and the Reset property to ToggleReset.
How it works:
We use the ToggleReset and ToggleDefault context variables to control the properties of the toggle button.
The Default property of the toggle control defines the default value of it (true or false)
The Reset property defines if the control should be reset to its default value. In case the user manually tapped the toggle control, we can use this property to reset the toggle control to its default value.
On change or on select(to ensure the variables update) of the combo box control, we first set the ToggleReset value to false. Next, depending on the selected value of the combo box, we set the ToggleDefault to true or false and set ToggleReset to true (this triggers the toggle control to reset its value to Default, which we defined with ToggleDefault)
Hope it helps.