Portal Community

What Reset Does

Clicking the reset action calls formEngine.reset(), which:

  1. Sets all field values back to the initialValues object (or empty if none were provided)
  2. Clears all validation errors
  3. Resets dirty and touched state — the form is treated as freshly loaded
  4. Does NOT clear the StorageManager draft (unlike cancel)
  5. Does NOT navigate away — the user stays on the same form page

Schema Example

{
  "type": "reset",
  "label": "Start Over",
  "variant": "secondary",
  "icon": "rotate-left",
  "order": 1,
  "config": {
    "showConfirmDialog": true,
    "confirmMessage": "Reset all fields to their default values?"
  }
}

Reset with initialValues

If you pass initialValues to FormRenderer, reset restores to those values — not to empty:

<FormRenderer
  schema={formSchema}
  initialValues={{
    country: 'US',
    currency: 'USD',
    status: 'active'
  }}
  mode="edit"
  onSubmit={handleSubmit}
/>
// After reset, country='US', currency='USD', status='active'

Use Cases

Confirm Before Reset

For forms with significant data, add a confirmation dialog to prevent accidental resets:

{
  "type": "reset",
  "label": "Reset to Defaults",
  "config": {
    "showConfirmDialog": true,
    "confirmMessage": "This will clear all your changes. Are you sure?"
  }
}
Reset vs Clear Draft Reset does not clear the StorageManager draft. If you want users to be able to resume from a clean state after reset, call storage.clearDraft(formId) after the reset completes. Wire this in a custom action if needed.