Hey guys ! i am running n8n from selfhost and i’m loving it. I just seem to not understand something in the way the Read file is working and it’s frustrating me.
My problem is simple i read data from a file on my server that looks like this :
And i want to take all these datas to format them but for some reason i can’t use {{ $json.test.id }} when i drag the id field it forces me to use {{ $json.test[0].id }} (picture shown here)
How are you getting the data? It seems from the images that when you extract it, it is returning it as a single item so when you try to select it in your set node, it will only ever select [0] as that is the only item it can select.
You could try to reconfigure how the data is created in the file it is coming from to return it correctly as multiple items or try and use a Split Out node after the Extract from File node to see if that can take the single item and return it as multiple items to achieve what you are looking for.
I’m assuming (as I can’t see it) that your data after extraction looks like this:
If that is the case, use the Split Out node after the Extract from File and drag test into the Fields to Split Out and that will turn the single item into multiple items.
If this is not how it looks, can you provide an example of the full JSON after it is extracted.