Describe the problem/error/question
I have a splitinbatches node that outputs 10 sheet rows at a time. i also have a javascript function node that gives me date and time in IST. I have a set function that takes these two as input. but the date value appears only once, since there is no loop inside the function. so, out of 10 rows, only one row gets a date time stamp.
how to ensure that all these 10 items get the same value from the function.
What is the error message (if any)?
Please share your workflow
Javascript function:
var date = new Date().toLocaleString(âen-USâ, {timeZone: âAsia/Kolkataâ})
var day = new Date().getDay();
//const weekday = [âSundayâ, âMondayâ, âTuesdayâ, âWednesdayâ, âThursdayâ, âFridayâ, âSaturdayâ];
var inputLength = 2;
for (i=0;i<inputLength;i++){
items[i].json.date_today = date;
//items[0].json.day_today = weekday[day];
}
return items;
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
Share the output returned by the last node
Information on your n8n setup
- n8n version:
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app):
- Operating system: