Guides
Retool Form Reset to Default Values (Not Just Clear)
If you've ever set default values on a Retool form — a field pre-populated with 0, a disabled display field, or a multiselect with a preset option — you've probably run into this frustrating problem: after submission, the "clear on submission" setting wipes every field completely blank instead of resetting them back to their defaults. The good news is that Retool form reset to default values is now a first-class feature in Form v2, and there's also a solid JavaScript workaround if you're on an older version.
Why "Clear on Submission" Falls Short
The built-in clear on submission behavior does exactly what it says — it clears everything. If a field has a default value of 0, after clearing the form that field won't show 0, it'll be blank. For forms used repeatedly in a modal (like a data entry form your team opens dozens of times a day), this is a real UX problem. Users see stale or missing defaults, disabled fields go blank, and multiselects lose their preset selections. The distinction between "clear" and "reset" matters: clear removes all values, while reset restores each field to its configured default value.
The Native Solution: form.reset() in Retool Form v2
Retool addressed this in the Form v2 component by introducing two separate methods:
form.clear()— removes all values, leaving fields blankform.reset()— restores every field to its configured default value
The on-submission behavior in Form v2 is also smarter by default: if a field has a default value configured, Retool will reset it to that default on submission. If no default is set, it clears the field. You can override this behavior manually using an event handler on the form's submit event, selecting Control component as the action and choosing either reset or clear to suit your needs.
To trigger a reset programmatically — for example, from a cancel button or a custom reset button — simply call form.reset() in a JavaScript action or wire it up through an event handler using Control component → reset.
How to Set Up Form Reset on Submission (Step by Step)
- Step 1: Make sure you are using the Form v2 component. If you're on the legacy Form component, you won't have access to
form.reset(). - Step 2: Set your default values on each form field as needed (e.g., set the default value of a number input to
0). - Step 3: In the Form component's settings, check the on-submission behavior. Form v2 defaults to resetting fields that have defaults and clearing fields that don't — this may already be all you need.
- Step 4: To customize further, add an event handler to the form's submit event. Choose Control component as the action type, select your form, and set the method to
reset. - Step 5: Test by submitting the form and confirming that all fields return to their default values rather than going blank.
JavaScript Workaround for Legacy Forms
If you're on an older Retool version or still using the legacy Form component and can't upgrade yet, there's a community-proven workaround using setData. The trick is to set all form data keys to null, which triggers Retool to fall back to each field's default value.
Create a transformer with the following code:
let x = {{FORMNAME.data}}; let k = _.keys(x); for (i = 0; i < k.length; i++) { x[k[i]] = null; } return x;
Then create an event handler that uses Control component → Set data → transformer.value targeting your form. Wire this to your submit button or add a dedicated reset button with an X icon. When triggered, this sets every field to null, which causes Retool to render the configured default value for each field instead of leaving them blank.
This approach works well for most field types, including number inputs, text fields, and selects. For multiselect components, this same technique brings them back to their default selection rather than an empty state — another pain point the community flagged alongside the main form reset issue.
Which Approach Should You Use?
If you're building a new form or can migrate to Form v2, use form.reset() — it's the cleanest, most maintainable solution and is officially supported. If you're maintaining a legacy form and a migration isn't practical right now, the setData + transformer workaround is reliable and battle-tested. Either way, you don't have to accept the "clear wipes defaults" behavior anymore.
Key Takeaways
- Retool's
clear on submissionremoves all values including defaults —resetrestores them. - Form v2 adds native
form.reset()and smarter default on-submission behavior. - Use an event handler → Control component → reset for no-code configuration.
- For legacy forms, use a transformer + setData to null out keys and restore defaults.
- The same reset logic applies to multiselect components that should return to a preset default.
Ready to build?
We scope, design, and ship your Retool app — fast.