I am trying to very simply output a modified column for a spreadsheet. My plan is more complicated but trying to make a simple example so we can debug it.
No matter what I do, i always only get one item output. I want the output to be an entire table with a modified column.
Ensure to copy your n8n workflow and paste it in the code block, that is in between the pairs of triple backticks, which also could be achieved by clicking </> (preformatted text) in the editor and pasting in your workflow.
```
<your workflow>
```
That implies to any JSON output you would like to share with us.
Your test appears to be “faulty”. In any case, the issue is not with the code. It works as per your code logic - an extra property added to each incoming item. Therefore, the issue is likely rather with your Google Sheet node.
As per your screenshot, when you run the test, you actually exclude the spreadsheet data and thus only one item is returned because in this case the input data to Code node is just [{json:{}}]. If you run the following code you will get the same result: