Formula: SetControlValue() , ResetControlValue()
Category: Action
SetControlValue()
Sets a value of a control to a user-defined value
or stated otherwise...
Hey Coda, will you please set the control to this value?
ResetControlValue()
Resets the value of a control
or said differently...
Hey Coda, I want you to reset this control to its baseline.
SetControlValue() has two parameters:
Control
SetControlValue(Control, Value)
The name of the control you want to set.
Value
SetControlValue(Control, Value)
The value to which you want to set the control.
ResetControlValue() has one parameter:
Control
ResetControlValue(Control)
The name of the control you want to reset.
As with all Action formulas, the SetControlValue() formula is used in the context of a button. When a button that contains this formula is pressed, SetControlValue() will set a control to a value you define within the formula.
ResetControlValue(), on the other hand, resets a control to a value defined not in the formula itself but rather in the “starting value” section of the control itself.
Explore the activity below and watch how the SetControlValue() and ResetControlValue() formulas work!
Let’s say you have a task list with tasks organized by high, medium, and low priorities. You want to provide your users a more app-like experience in filtering the task list and hope to do so by filtering the table with buttons.
Control That Contains The Priority Value: Button To Set The Priority Control:
Button To Reset The Priority Control:
A Note About ResetControlValue()
ResetControlValue() only takes one parameter, that being the control you want to reset. But what does value does it reset a control to? You can actually define the value of a control as its starting-value, but it’s not done in the button formula, rather its configured on the control itself.
Believe it or not, the two buttons below have the exact same formula, yet the do completely different things. Don’t believe me? Click into their configurations to see for yourself!