I have a function-backed create action and users utilize it via a button in a Workshop app. There are data validation checks in the function (i.e. A + B must equal C for form to be submitted). When a user does not have the condition met the function fails and provides an error message telling the user what they need to fix.
However, the form itself is cleared out so the user has to start over from scratch. Are there any options I have to preserve the input form info for the user when an action fails?
Hey @ggsmith842 !
Off the bat
Option 1 — Rebuild the form with Workshop primitives (no code)
Instead of using the action’s built-in form, wire everything manually:
-
Drop individual input widgets (Text Input, Number Input, etc.) onto your canvas — one per parameter
-
Each widget stores its value as a Workshop variable
-
Configure your button’s action to reference those variables as the action parameters, rather than using the auto-generated form
-
On failure, the variables retain their values because you own them — Workshop won’t reset them
-
The one thing you take on: you need to handle reset logic yourself (e.g. a “Clear” button that resets all variables to null/default)
This is the fastest path and requires zero code.
Option 2 — Custom Widget or OSDK Component (full control)
If you need richer validation UX (inline field errors, partial highlights, etc.), build the form as a custom widget or an OSDK-backed component. You own the full state machine, you decide when to clear, what to surface on error, and how to re-invoke the function. More investment upfront, but the right call if the form is complex or user-facing polish matters.
Good Luck
Nico
1 Like