Happy to help with this@Monika!
With the Google Sheets spreadsheet the headers should be whatever is most relevant to the data they’re going to contain. In the screenshot of an example Google Sheets spreadsheet I just stored the name of the employee and the individual holiday dates so I created two columns one called Name and another called Dates. But you could have fields called Employee Name and Holiday Dates for example. It’s totally up to you.
If helpful, you can find out more about how to best set up Google Sheets spreadsheets to work with Zaps here: Work with Google Sheets in Zaps
If you’re using the New Event (Google Calendar) trigger instead of using BambooHR then for the Input Data section you’d want to select the Event Begins and Event Ends fields in the Code step instead. For example:

That said, I don’t know whether BambooHR adds the events as all day events or sets a start and end time. If it adds them as all day events then the event will likely be set as finishing at 12:00am on the next day which isn’t ideal as it would mean you’d get a list of dates that includes the day after the end of the holiday. So for an all day event that starts on November 17th and ends on November 19th, Google Calendar would have 2023-11-20 in the Event Ends field (as pictured in the screenshot above).
In which case you’d want to use the following code in the Code by Zapier action instead:
function getDates(startDate, endDate) {
var dates = [];
var currentDate = new Date(startDate);
var stopDate = new Date(endDate);
while (currentDate < stopDate) {
dates.push(new Date(currentDate));
currentDate.setDate(currentDate.getDate() + 1);
}
return dates;
}
var startDate = inputData.startDate;
var endDate = inputData.endDate;
var dates = getDates(startDate, endDate);
var output = [];
for (var i = 0; i < dates.length; i++) {
output.push({ line_item: dates[i] });
}
output = { dates: output };
And that should get it to ignore the last day (November 20th) and only output 2023-11-17T00:00:00.000Z, 2023-11-18T00:00:00.000Z and 2023-11-19T00:00:00.000Z like so:

Does that make sense? Let me know if that doesn’t work or if you need any further assistance at all on this. 🙂