Describe the problem/error/question
I’m seeing unexpected results when using read from file - write to file (with append)…
What is the error message (if any)?
Unexpected non-whitespace character after JSON at position XX
The issue is that when new data is appended to same file it joins inputs but in same way it breaks structure. E.g. if I utilize csv, next time when it appends data it will also append header again, and it will break data. When it comes to JSON it will append something like this
In step 1. - creation of file will add →
[
{
"appended_task_domain": "test.powerappsportals.com"
},
{
"appended_task_domain": "test2.powerappsportals.com"
},
{
"appended_task_domain": "test3.powerappsportals.com"
}
]
- Next time when it appends it will add again
[
{
"appended_task_domain": "test4.powerappsportals.com"
},
{
"appended_task_domain": "test5.powerappsportals.com"
}
]
- Final look of json content will be:
[
{
"appended_task_domain": "test.powerappsportals.com"
},
{
"appended_task_domain": "test2.powerappsportals.com"
},
{
"appended_task_domain": "test3.powerappsportals.com"
}
][
{
"appended_task_domain": "test4.powerappsportals.com"
},
{
"appended_task_domain": "test5.powerappsportals.com"
}
]
As you can see, the JSON is not real JSON and it will break on node “extract from file (json)”
Please share your workflow
Share the output returned by the last node
After first extract from file (json)
[
{
"data":
[
{
"appended_task_domain":
"test.powerappsportals.com"
},
{
"appended_task_domain":
"test2.powerappsportals.com"
},
{
"appended_task_domain":
"test3.powerappsportals.com"
},
{
"appended_task_domain":
"test4.powerappsportals.com"
},
{
"appended_task_domain":
"test5.powerappsportals.com"
}
]
}
]
Information on your n8n setup
- last docker image pulled today, no other custom modifications
Disclaimer 
I am quite sure that I made mistake with data formatting somewhere…any help or hack/tip is welcome as most of workflow is done and the only thing not working is saving and reading from file after multiple times