I then tried to convert the string via .split(’’), […string], Array.from(string) and Object.assign([], string), but neither of these options seem to return the key value pairs that I’m looking for …
return [{json: {test: JSON.parse($evaluateExpression($node["FileMaker Data API"].json["response"]["dataInfo"]))}}]
I get the following error:
ERROR: Unexpected token o in JSON at position 1
SyntaxError: Unexpected token o in JSON at position 1
at JSON.parse (<anonymous>)
at /Applications/n8n.app/Contents/Resources/app/node_modules/n8n-nodes-base/dist/nodes/Function:7:28
at /Applications/n8n.app/Contents/Resources/app/node_modules/n8n-nodes-base/dist/nodes/Function:12:2
at BaseHandler.apply (/Applications/n8n.app/Contents/Resources/app/node_modules/vm2/lib/bridge.js:479:11)
at NodeVM.run (/Applications/n8n.app/Contents/Resources/app/node_modules/vm2/lib/nodevm.js:425:23)
at Object.execute (/Applications/n8n.app/Contents/Resources/app/node_modules/n8n-nodes-base/dist/nodes/Function/Function.node.js:95:31)
at Workflow.runNode (/Applications/n8n.app/Contents/Resources/app/node_modules/n8n-workflow/dist/src/Workflow.js:526:37)
at /Applications/n8n.app/Contents/Resources/app/node_modules/n8n-core/dist/src/WorkflowExecute.js:451:62
I have the same issue. I want to add the json data from the previous node, but if I just use $json it doesn’t work out… The next node tells me it’s not valid json
@Jon then it works, but that would be way too easy. Joke aside, wtf man thanks, I tried JSON.parse but obviously it’s the other one. Was a long session and I was convinced I’m thinking about it the right way… Thanks and sorry for the stupidity on my part lol