Hi, I’m very new to n8n. My coding skills are very basic though.
I have function that calculates difference between parsed dates. For example I get this JSON data from previous nodes(3 items):
[
{
"UID": 2,
"USER_ID": 8593847591,
"USERNAME": "John",
"PUBLISH_DATE": 1641789802000,
"CURRENT_DATE": 1642058123000
},
{
"UID": 8,
"USER_ID": 59384595045,
"USERNAME": "Susan",
"PUBLISH_DATE": 1641952418000,
"CURRENT_DATE": 1642058123000
},
{
"UID": 9,
"USER_ID": 9504832934,
"USERNAME": "Chris",
"PUBLISH_DATE": 1641836651000,
"CURRENT_DATE": 1642058123000
}
]
and after function I get only 1 item instead of 3 calculations. I understand that I need to use array, but I don’t know how to do it correctly and I get an error:
“Always an Array of items has to be returned!”