Extract from JSON file?

I am trying to read a local json file and then use the json later in the flow.

With the code below, I get the following error: ERROR: The file selected in 'Input Binary Field' is not in JSON format Try to change the operation or select a JSON file in 'Input Binary Field' NodeOperationError: The file selected in 'Input Binary Field' is not in JSON format at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Files/ExtractFromFile/actions/moveTo.operation.js:161:19) at processTicksAndRejections (node:internal/process/task_queues:95:5) at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Files/ExtractFromFile/ExtractFromFile.node.js:140:26) at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:730:19) at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:660:53 at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1062:20

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @oguruma,

I have just given it a quick go and it seems to work, Can you share the JSON file you are trying to read?

@Jon

[{"article":"/news/local/court-docs-lincoln-county-man-killed-mom-because-he-believed-she-was-a-vampire#"}][{"article":"/news/local/court-docs-lincoln-county-man-killed-mom-because-he-believed-she-was-a-vampire#"}][{"article":"/sports/gallery-uo-vs-up#"}][{"article":"/news/local/non-profit-highlights-disparity-in-oregon-kicker-rebates#"}][{"article":"/news/local/court-docs-lincoln-county-man-killed-mom-because-he-believed-she-was-a-vampire#"}][{"article":"/sports/gallery-uo-vs-up#"}][{"article":"/news/local/non-profit-highlights-disparity-in-oregon-kicker-rebates#"}]

hello @oguruma

The file you have specified is not a proper JSON or JSONL. The root arrays should be placed on the newline to match JSONL syntax. But n8n does not support it :slight_smile:

You can fix it with a code node