-
Notifications
You must be signed in to change notification settings - Fork 50.8k
feat(Form Node): Allow users to set a default value for form fields #22200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This comment has been minimized.
This comment has been minimized.
|
E2E Tests: n8n tests passed after 9m 10.7s Run Details
Groups
This message was posted automatically by
currents.dev | Integration Settings
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 5 files
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="packages/workflow/src/type-validation.ts">
<violation number="1" location="packages/workflow/src/type-validation.ts:164">
Rule violated: **Tests**
Adding `'defaultValue'` to `ALLOWED_FORM_FIELDS_KEYS` changes form-field validation but there are no unit tests covering `tryToParseJsonToFormFields` with a `defaultValue`, violating Community PR Guidelines §2 testing requirements. Please add a test ensuring a field containing `defaultValue` parses successfully.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
| displayOptions: { | ||
| hide: { | ||
| fieldType: ['dropdown', 'date', 'file', 'html', 'hiddenField', 'radio', 'checkbox'], | ||
| }, | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I applied the same rules as for Placeholder form field.
Summary
Allow users to set a default value inside a form field (fixed or expression), so then the value in the actual rendered form is prefilled.
Figma recording - form fields
Figma recording - JSON support (David's suggestion)
Questions to the Team:
Related Linear tickets, Github issues, and Community forum posts
https://linear.app/n8n/issue/NODE-3743/default-values-in-form-fields
Review / Merge checklist
release/backport(if the PR is an urgent fix that needs to be backported)