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:
None
Button To Set The Priority Control:
High Priority
Medium Priority
Low Priority
Button To Reset The Priority Control:
Reset
My Task List
Task
Priority
Due Date
Task
Priority
Due Date
No results from filter
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!
Difficulty Control:
Blank
Set Easy
Reset to Blank
Difficulty Control:
EasyMediumHard
Set Easy
Reset to All Values
Practice: Set a date control to todays date
Done
Create an app-like experience for your users by filtering a table with buttons
Done
Reset a control value to a value defined in the control itself