Form Node with JSON not working as Doc says

HI,

I have a question regarding “Next Form Page” node.
When setting the Form as “Using JSON”, I really have problems getting it to work with dropdown. So i looked at the documentation

And tried out the example JSON as an expression there, which of course should work:

// Use the “requiredField” key on any field to mark it as mandatory
// Use the “placeholder” key to specify placeholder data for all fields
// except ‘dropdown’, ‘date’ and ‘file’

[
{
“fieldLabel”: “Date Field”,
“fieldType”: “date”,
“formatDate”: “mm/dd/yyyy”, // how to format received date in n8n
“requiredField”: true
},
{
“fieldLabel”: “Dropdown Options”,
“fieldType”: “dropdown”,
“fieldOptions”: {
“values”: [
{
“option”: “option 1”
},
{
“option”: “option 2”
}
]
},
“requiredField”: true
},
{
“fieldLabel”: “Multiselect”,
“fieldType”: “dropdown”,
“fieldOptions”: {
“values”: [
{
“option”: “option 1”
},
{
“option”: “option 2”
}
]
},
“multiselect”: true // setting to true allows multi-select
},
{
“fieldLabel”: “Email”,
“fieldType”: “email”,
“placeholder”: “[email protected]
},
{
“fieldLabel”: “File”,
“fieldType”: “file”,
“multipleFiles”: true, // setting to true allows multiple files selection
“acceptFileTypes”: “.jpg, .png” // allowed file types
},
{
“fieldLabel”: “Number”,
“fieldType”: “number”
},
{
“fieldLabel”: “Password”,
“fieldType”: “password”
},
{
// “fieldType”: “text” can be omitted since it’s the default type
“fieldLabel”: “Text”
},
{
“fieldLabel”: “Textarea”,
“fieldType”: “textarea”
}
]

But even with that, when testing that node I get the error:
Value is not valid JSON

Node type

n8n-nodes-base.form

Node version

1 (Latest)

n8n version

1.88.0 (Self Hosted)

Time

4/25/2025, 1:18:09 PM

Stack trace

NodeOperationError: Value is not valid JSON at Form.webhook (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Form/Form.node.js:343:15) at WebhookService.runWebhook (/usr/local/lib/node_modules/n8n/dist/webhooks/webhook.service.js:180:30) at Object.executeWebhook (/usr/local/lib/node_modules/n8n/dist/webhooks/webhook-helpers.js:302:92) at processTicksAndRejections (node:internal/process/task_queues:95:5)

How is it possible that even the doc version isnt working?

Hi, JSON cant use annotation like

// “fieldType”: “text” can be omitted since it’s the default type

I delete the annotation in sample, try this

[
{
"fieldLabel": "Date Field",
"fieldType": "date",
"formatDate": "mm/dd/yyyy",
"requiredField": true
},
{
"fieldLabel": "Dropdown Options",
"fieldType": "dropdown",
"fieldOptions": {
"values": [
{
"option": "option 1"
},
{
"option": "option 2"
}
]
},
"requiredField": true
},
{
"fieldLabel": "Multiselect",
"fieldType": "dropdown",
"fieldOptions": {
"values": [
{
"option": "option 1"
},
{
"option": "option 2"
}
]
},
"multiselect": true
},
{
"fieldLabel": "Email",
"fieldType": "email",
"placeholder": "[email protected]"
},
{
"fieldLabel": "File",
"fieldType": "file",
"multipleFiles": true,
"acceptFileTypes": ".jpg, .png" 
},
{
"fieldLabel": "Number",
"fieldType": "number"
},
{
"fieldLabel": "Password",
"fieldType": "password"
},
{
"fieldLabel": "Text"
},
{
"fieldLabel": "Textarea",
"fieldType": "textarea"
}
]

Thank you very much @J_oseph
Now I know :slight_smile: