Describe the problem/error/question
I have a stringified JSON which I am parsing into JSON and attempting to create a new column for the object. I want to extract the date from a previous node and set it here. When I try to set this new columns value though, it doesnt error out or set the new column as I expect.
This is the Javascript code I am using to do the transformation:
// convert stringified JSON to JSON
const stringJSON = $input.all()[0].json.json_data;
const dateStr = $input.all()[0].json.date;
const dateObj = new Date(dateStr);
const formattedDate = dateObj.toISOString().split(‘T’)[0];
const jsonObject = JSON.parse(stringJSON);
jsonObject.date = formattedDate
return jsonObject;
What is the error message (if any)?
None
Please share your workflow
Share the output returned by the last node
[
{
“success”: true
}
]
Information on your n8n setup
- n8n version:
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app):
- Operating system: