Skip to main content
0 reactions

Fixed: unexpected array input in row 0 (n8n Data Table)

Card titled Fixed: unexpected array input in row 0, labelled n8n fix, with a warning sign and two notes: checkboxes give a list, and the fix, joining the list with a comma and a space.

Saving the answer to a checkbox question from an n8n form with the Data table node stopped with unexpected array input … in row 0. The answer was a list, and a data table column takes one value. Joining the list into text fixed it.

What I Was Doing

I was building the three-page sign-up form from n8n Tutorial — Part 5: Forms: Collect Data with n8n Forms, in n8n 2.49.5 running in Docker. The form’s last page asks What would you like to hear about? with three checkboxes. A Data table node with the Insert row action saves every answer in a table, where topics is a string (text) column.

I dragged the checkbox answer onto topics, and n8n wrote this expression for it:

topics (Expression)Plain text
{{ $json['What would you like to hear about?'] }}

Then I sent a test submission with two boxes ticked, opened the node and clicked Execute step.

What I Expected

The node to save one row, with both ticked topics in the topics column.

What I Got

The node stopped, and n8n showed this error:

OutputPlain text
Problem in node ‘Insert row‘
unexpected array input '["The characters","Getting published"]' in row 0
The OUTPUT panel of the n8n Data table node with a warning sign and the error unexpected array input, listing The characters and Getting published, in row 0.
The node stopped with unexpected array input … in row 0.

What I Checked

Under each field, n8n previews the value its expression gives. Under topics, the preview wasn’t text but a list (an array), with one entry for each ticked box:

The topics field of the n8n Data table node, with the expression for the checkbox question and, under it, the preview Array: The characters, Getting published.
The preview under topics shows a list, not text.

That matches n8n’s Form Trigger docs (opens in a new tab): a visitor can tick as many checkboxes as they like, so the answer holds every option they ticked.

Why It Happens

A data table column holds one value in each row, and its type is string, number, boolean or datetime. There’s no type for a list. Before it saves a row, the Data table node checks every value and stops at the first list it finds. In n8n’s source code, that check is the function dataObjectToApiInput in DataTable/common/utils.ts (opens in a new tab), which raises this error for any array.

row 0 is the item’s number. n8n counts the items a node receives from 0, so row 0 is the first item.

The Fix

Turn the list into text before the node saves it, with join. n8n’s expression reference (opens in a new tab) describes it as merging every element of an array into one string, with an optional separator between them.

In the Insert row node, click the topics field and add .join(', ') at the end of the expression, before the closing }}:

topics (Expression)Plain text
{{ $json['What would you like to hear about?'].join(', ') }}

The ', ' is what goes between the answers: a comma and a space. For a bigger editor, click the field’s expand icon at its bottom right:

The n8n expression editor showing the expression for the checkbox question followed by .join with a comma and a space, all inside the double curly braces.
The fix: .join with a comma and a space, inside the curly braces.

If more than one column gets checkbox answers, add .join(', ') to each of them.

After the Fix

The expression now gives one line of text, The characters, Getting published. I clicked Execute step again, and the node saved the row:

The OUTPUT panel of the n8n Data table node in JSON view with a green check, showing the saved row with topics set to The characters, Getting published and id 1.
With the join, the node saves the row.

Common Mistakes

MistakeWhat happensDo this instead
.join() with nothing between the bracketsThe answers run together with only a comma: The characters,Getting publishedWrite .join(', '), with a comma and a space
Joining one checkbox answer but not anotherThe node stops with the same error, showing the other listAdd .join(', ') to every column that gets checkbox answers

FAQ

What if a visitor ticks no box?

The row still saves, and the form ends on its thank-you page as usual.

Why does the error say row 0?

n8n counts the items a node receives from 0, so row 0 is the first item. A form submission arrives as one item.

Can a data table store the answers as a list?

No. Its column types are string, number, boolean and datetime, so a list goes in as text, as in the fix.

Conclusion

unexpected array input … in row 0 means the Data table node got a list where a column needs one value. The answer to an n8n form’s checkbox question is such a list. Add .join(', ') to its expression, before the closing }}, and the answers are saved as one line of text.

Additional Resources

n8n and other names mentioned are trademarks of their respective owners. JD Bots isn’t affiliated with or endorsed by n8n GmbH.

0 comments