10000 feat(Form Node): Allow users to set a default value for form fields by DawidMyslak · Pull Request #22200 · n8n-io/n8n · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@DawidMyslak
Copy link
Contributor
@DawidMyslak DawidMyslak commented Nov 23, 2025

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:

  • Does this change require documentation update?
  • Does it make sense to not introduce a new node version for this change?

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/NODE-3743/default-values-in-form-fields

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team node/improvement New feature or request labels Nov 23, 2025
@codecov
Copy link
codecov bot commented Nov 23, 2025

Codecov Report

❌ Patch coverage is 37.50000% with 10 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/cli/src/utils/handlebars.util.ts 23.07% 10 Missing ⚠️

📢 Thoughts on this report? Let us know!

@blacksmith-sh

This comment has been minimized.

@currents-bot
Copy link
currents-bot bot commented Nov 23, 2025

E2E Tests: n8n tests passed after 9m 10.7s

🟢 588 · 🔴 0 · ⚪️ 12 · 🟣 3

View Run Details

Run Details

  • Project: n8n

  • Groups: 2

  • Framework: Playwright

  • Run Status: Passed

  • Commit: ba66260

  • Spec files: 96

  • Overall tests: 600

  • Duration: 9m 10.7s

  • Parallelization: 9

Groups

GroupId Results Spec Files Progress
ui 🟢 539 · 🔴 0 · ⚪️ 12 · 🟣 3 90 / 90
ui:isolated 🟢 49 · 🔴 0 · ⚪️ 0 6 / 6


This message was posted automatically by currents.dev | Integration Settings

@DawidMyslak DawidMyslak marked this pull request as ready for review November 24, 2025 08:09
Copy link
Contributor
@cubic-dev-ai cubic-dev-ai bot left a 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 `&#39;defaultValue&#39;` 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

Comment on lines +176 to +180
displayOptions: {
hide: {
fieldType: ['dropdown', 'date', 'file', 'html', 'hiddenField', 'radio', 'checkbox'],
},
},
Copy link
Contributor Author

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.

@Joffcom Joffcom requested a review from yehorkardash November 24, 2025 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team node/improvement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0