Working with Arrays and Items - Removing "json:" from items

HI @pb84

When retrieving the $items() you get the full items array which contains json and binary data. If you then put this in a field you will simply get the full items array in that single field.
When creating your own array you also have that JSON key set but n8n will interpret your array and it gets split with the JSON data and binary data to show you both in the GUI.

[
	{
	json:{
		text1:[
			{
			json:{
				id:
			}
			}
		]
		text2:[{
		item1:result1
		item2:result2
		},{
		item1:result1
		item2:result2
		}
		]
	}
	}
]

So they are both set within the json of n8n but your text 1 also includes the full items array with that json you retrieved by getting $items()
The second text is a simple array you build.

Hope this makes sense.
The fix depends on what you actually want to do. using the item lists node will allow you to easily split the items and process from there, if that is what you are after.

2 Likes