I have a text file that contains a json string located at the end of e file and I want to extract it. How can I do this? my workflow is giving me undefined error. Here’s the textfile for testing purpose https://pastebin.com/raw/W4bnsraa
Hi @Ruriko
I reproduced your workflow on my machine and figured out exactly what’s going on. You are actually super close, but two tiny formatting details are tripping up the node.
If you look closely at your expression, you have an = sitting right before the {{ }} brackets. In n8n, starting an expression with = forces the output to become a plain text string that literally starts with an equals sign. That’s why your preview shows =[object Object] instead of real data. Just delete that = so your expression starts directly with the curly brackets.
Because your JSON block starts and ends with [ ] brackets, it’s technically a list of items (an Array), not a single Object or String. In your Edit Fields node, look right next to your data field name and change the type dropdown to Array.