Every Monday morning, posts who is on leave this week from BambooHR to Slack, with their dates, holidays and work anniversaries.

UsesBambooHRSlack

Tell the team who's out this week

On Monday morning nobody knows who is off this week, so meetings get booked with people who are away, cover isn't arranged and HR spends the week answering "is Sam off?". Every Monday at 08:00, the week's approved time off and company holidays are read from BambooHR and posted to your team's Slack channel as one message: how many people are out, then each person with the real dates of their leave, so someone away since last Thursday or back next Tuesday shows exactly that. Company holidays follow, then the work anniversaries that fall this week, such as "Priya Shah – 3 years on Wednesday".

Only names and dates are posted. The type of leave stays private unless you switch it on, so a sick day reads simply as a day out. A week with nobody away gets one short line saying so. If BambooHR can't be read, nothing is posted and the run is marked as failed, so an outage never reads as "nobody is out"; if only the anniversaries can't be checked, who's out is still posted and the run names what was left out.

You need BambooHR and Slack connected, with BambooHR connected through an HR admin's account so it can see everyone's time off and hire dates, and the ID of the Slack channel the message goes to. Two settings let you show the type of leave and switch anniversaries off.

ScheduleRun every Monday at 08:00.Run every Monday at 08:00.
ValuesSet showLeaveType to false.Set showLeaveType to false.
ValuesSet includeWorkAnniversaries to true.Set includeWorkAnniversaries to true.
ValuesSet slackChannelId to blank.Set slackChannelId to blank.
Dates & TimesGet today's date and save it as today.Get today's date and save it as today.
Dates & TimesGet the start of the week for today and save it as weekStart.Get the start of the week for today and save it as weekStart.
Dates & TimesGet the end of the week for today and save it as weekEnd.Get the end of the week for today and save it as weekEnd.
Dates & TimesMake weekStart readable as “2 Nov” and save it as weekFrom.Make weekStart readable as “2 Nov” and save it as weekFrom.
Dates & TimesMake weekEnd readable as “2 Nov” and save it as weekTo.Make weekEnd readable as “2 Nov” and save it as weekTo.
ValuesSet entries to an empty list.Set entries to an empty list.
ValuesSet nextPage to 1.Set nextPage to 1.
ValuesSet morePages to true.Set morePages to true.
Decisions & LoopsWhile morePages is yes:While morePages is yes:
Decisions & LoopsIf a step below fails, save the error as readErrorIf a step below fails, save the error as readError
Try
BambooHRBambooHRList who's out in BambooHR from weekStart to weekEnd. Save it as whosOut.List who's out in BambooHR from weekStart to weekEnd. Save it as whosOut.
ListsCombine entries and whosOut.entries into one list and save it as entries.Combine entries and whosOut.entries into one list and save it as entries.
ValuesChange morePages to whosOut.has_more.Change morePages to whosOut.has_more.
On error
Decisions & LoopsStop and report a problem: Nothing was posted: who's out could not be read from BambooHR (readError.message). Check the BambooHR connection under Integrations, then run the workflow again.Stop and report a problem: Nothing was posted: who's out could not be read from BambooHR (readError.message). Check the BambooHR connection under Integrations, then run the workflow again.
ValuesAdd 1 to nextPage.Add 1 to nextPage.
ListsKeep each item in entries where item.type in lowercase is holiday and save it as holidays.Keep each item in entries where item.type in lowercase is holiday and save it as holidays.
ListsKeep each item in entries where item.type in lowercase is not holiday and save it as absences.Keep each item in entries where item.type in lowercase is not holiday and save it as absences.
Decisions & LoopsIf showLeaveType is yesIf showLeaveType is yes
Yes
Decisions & LoopsIf a step below fails, save the error as typesErrorIf a step below fails, save the error as typesError
Try
BambooHRBambooHRList time off types. Save it as leaveTypes.List time off types. Save it as leaveTypes.
ListsRename fields in leaveTypes.time_off_types and save it as leaveTypeNames.Rename fields in leaveTypes.time_off_types and save it as leaveTypeNames.
ListsMatch absences with leaveTypeNames by timeOffTypeId and save it as absences.Match absences with leaveTypeNames by timeOffTypeId and save it as absences.
On error
Decisions & LoopsStop and report a problem: Nothing was posted: the types of leave could not be read from BambooHR (typesError.message). Check the BambooHR connection, or set showLeaveType to false, then run the workflow again.Stop and report a problem: Nothing was posted: the types of leave could not be read from BambooHR (typesError.message). Check the BambooHR connection, or set showLeaveType to false, then run the workflow again.
No
No steps
ListsSort absences by name, smallest first and save it as absencesByName.Sort absences by name, smallest first and save it as absencesByName.
ListsSort absencesByName by start, smallest first and save it as absencesInOrder.Sort absencesByName by start, smallest first and save it as absencesInOrder.
ListsGroup the items in absencesInOrder by employeeId and save it as peopleOut.Group the items in absencesInOrder by employeeId and save it as peopleOut.
ValuesSet personLines to an empty list.Set personLines to an empty list.
Decisions & LoopsFor each person in peopleOut:For each person in peopleOut:
ValuesSet periods to an empty list.Set periods to an empty list.
Decisions & LoopsFor each absence in person.items:For each absence in person.items:
Dates & TimesMake absence.start readable as “Mon 2 Nov” and save it as period.Make absence.start readable as “Mon 2 Nov” and save it as period.
Decisions & LoopsIf absence.end is not absence.startIf absence.end is not absence.start
Yes
Dates & TimesMake absence.end readable as “Mon 2 Nov” and save it as absenceLastDay.Make absence.end readable as “Mon 2 Nov” and save it as absenceLastDay.
ValuesChange period to period to absenceLastDay.Change period to period to absenceLastDay.
No
No steps
TextUse absence.leaveType, or if it is empty and save it as leaveTypeName.Use absence.leaveType, or if it is empty and save it as leaveTypeName.
Decisions & LoopsIf leaveTypeName isn't blankIf leaveTypeName isn't blank
Yes
ValuesChange period to period (leaveTypeName).Change period to period (leaveTypeName).
No
No steps
ListsAdd period to the end of periods and save it as periods.Add period to the end of periods and save it as periods.
TextJoin periods with , and save it as periodList.Join periods with , and save it as periodList.
ListsAdd • person.items[0].name – periodList to the end of personLines and save it as personLines.Add • person.items[0].name – periodList to the end of personLines and save it as personLines.
ListsSort holidays by start, smallest first and save it as holidaysInOrder.Sort holidays by start, smallest first and save it as holidaysInOrder.
ValuesSet holidayLines to an empty list.Set holidayLines to an empty list.
Decisions & LoopsFor each holiday in holidaysInOrder:For each holiday in holidaysInOrder:
Dates & TimesMake holiday.start readable as “Mon 2 Nov” and save it as holidayDates.Make holiday.start readable as “Mon 2 Nov” and save it as holidayDates.
Decisions & LoopsIf holiday.end is not holiday.startIf holiday.end is not holiday.start
Yes
Dates & TimesMake holiday.end readable as “Mon 2 Nov” and save it as holidayLastDay.Make holiday.end readable as “Mon 2 Nov” and save it as holidayLastDay.
ValuesChange holidayDates to holidayDates to holidayLastDay.Change holidayDates to holidayDates to holidayLastDay.
No
No steps
ListsAdd • holiday.name – holidayDates to the end of holidayLines and save it as holidayLines.Add • holiday.name – holidayDates to the end of holidayLines and save it as holidayLines.
ValuesSet anniversaries to an empty list.Set anniversaries to an empty list.
ValuesSet anniversaryProblems to an empty list.Set anniversaryProblems to an empty list.
Decisions & LoopsIf showLeaveType is yes and absences isn't empty and the items in absences where…If showLeaveType is yes and absences isn't empty and the items in absences where…
Yes
ListsAdd the type of leave was left out because BambooHR did not say which type each absence is. Set showLeaveType to false to post without it. to the end of anniversaryProblems and save it as anniversaryProblems.Add the type of leave was left out because BambooHR did not say which type each absence is. Set showLeaveType to false to post without it. to the end of anniversaryProblems and save it as anniversaryProblems.
No
No steps
Decisions & LoopsIf includeWorkAnniversaries is yesIf includeWorkAnniversaries is yes
Yes
ValuesSet colleagues to an empty list.Set colleagues to an empty list.
ValuesSet datedColleagues to an empty list.Set datedColleagues to an empty list.
ValuesSet staffCursor to blank.Set staffCursor to blank.
ValuesSet moreStaff to true.Set moreStaff to true.
Decisions & LoopsIf a step below fails, save the error as staffErrorIf a step below fails, save the error as staffError
Try
Decisions & LoopsWhile moreStaff is yes:While moreStaff is yes:
BambooHRBambooHR List employees. Save it as staffPage. List employees. Save it as staffPage.
Lists Combine colleagues and staffPage.employees into one list and save it as colleagues. Combine colleagues and staffPage.employees into one list and save it as colleagues.
Values Change staffCursor to staffPage.next_cursor. Change staffCursor to staffPage.next_cursor.
Values Change moreStaff to staffPage.has_more. Change moreStaff to staffPage.has_more.
ListsKeep each item in colleagues where item.hireDate, or if it is empty isn't blank and item.hireDate is not… and save it as datedColleagues.Keep each item in colleagues where item.hireDate, or if it is empty isn't blank and item.hireDate is not… and save it as datedColleagues.
ListsKeep each item in colleagues where item._restrictedFields contains hireDate and save it as hiddenHireDates.Keep each item in colleagues where item._restrictedFields contains hireDate and save it as hiddenHireDates.
ListsCount the items in colleagues and save it as activeCount.Count the items in colleagues and save it as activeCount.
Decisions & LoopsIf activeCount is 0If activeCount is 0
Yes
ListsAdd work anniversaries were left out because BambooHR returned no active employees. Connect BambooHR with a key from someone who can see everyone's records. to the end of anniversaryProblems and save it as anniversaryProblems.Add work anniversaries were left out because BambooHR returned no active employees. Connect BambooHR with a key from someone who can see everyone's records. to the end of anniversaryProblems and save it as anniversaryProblems.
Else if @hiddenHireDates isn't empty
ListsCount the items in hiddenHireDates and save it as hiddenCount.Count the items in hiddenHireDates and save it as hiddenCount.
ListsAdd BambooHR hides the hire date of hiddenCount of your activeCount active employees from this connection, so their work anniversaries were left out. Connect BambooHR with a key from someone who can see hire dates, or set includeWorkAnniversaries to false. to the end of anniversaryProblems and save it as anniversaryProblems.Add BambooHR hides the hire date of hiddenCount of your activeCount active employees from this connection, so their work anniversaries were left out. Connect BambooHR with a key from someone who can see hire dates, or set includeWorkAnniversaries to false. to the end of anniversaryProblems and save it as anniversaryProblems.
Else if @datedColleagues is empty
ListsAdd work anniversaries were left out because none of your activeCount active employees has a hire date in BambooHR. to the end of anniversaryProblems and save it as anniversaryProblems.Add work anniversaries were left out because none of your activeCount active employees has a hire date in BambooHR. to the end of anniversaryProblems and save it as anniversaryProblems.
Otherwise
No steps
On error
ValuesChange datedColleagues to an empty list.Change datedColleagues to an empty list.
ListsAdd work anniversaries were left out because the employee list could not be read from BambooHR (staffError.message). to the end of anniversaryProblems and save it as anniversaryProblems.Add work anniversaries were left out because the employee list could not be read from BambooHR (staffError.message). to the end of anniversaryProblems and save it as anniversaryProblems.
ValuesSet unreadableHireDates to an empty list.Set unreadableHireDates to an empty list.
Decisions & LoopsFor each colleague in datedColleagues:For each colleague in datedColleagues:
Decisions & Loops If a step below fails, save the error as dateError If a step below fails, save the error as dateError
Try
Dates & TimesCount the years from colleague.hireDate to weekEnd and save it as yearsBySunday.Count the years from colleague.hireDate to weekEnd and save it as yearsBySunday.
Decisions & LoopsIf yearsBySunday is greater than or equal to 1If yearsBySunday is greater than or equal to 1
Yes
Dates & TimesMove colleague.hireDate by yearsBySunday years and save it as anniversaryDate.Move colleague.hireDate by yearsBySunday years and save it as anniversaryDate.
Decisions & LoopsIf the difference between weekStart and anniversaryDate in days is greater than…If the difference between weekStart and anniversaryDate in days is greater than…
Yes
TextUse colleague.displayName, or colleague.firstName colleague.lastName if it is empty and save it as colleagueName.Use colleague.displayName, or colleague.firstName colleague.lastName if it is empty and save it as colleagueName.
Dates & TimesGet the day of the week for anniversaryDate and save it as anniversaryDay.Get the day of the week for anniversaryDate and save it as anniversaryDay.
ValuesSet yearsText to yearsBySunday years.Set yearsText to yearsBySunday years.
Decisions & LoopsIf yearsBySunday is 1If yearsBySunday is 1
Yes
ValuesChange yearsText to 1 year.Change yearsText to 1 year.
No
No steps
ListsAdd a record of date and line to the end of anniversaries and save it as anniversaries.Add a record of date and line to the end of anniversaries and save it as anniversaries.
No
No steps
No
No steps
On error
ListsAdd colleague.displayName to the end of unreadableHireDates and save it as unreadableHireDates.Add colleague.displayName to the end of unreadableHireDates and save it as unreadableHireDates.
Decisions & LoopsIf unreadableHireDates isn't emptyIf unreadableHireDates isn't empty
Yes
TextJoin unreadableHireDates with , and save it as unreadableNames.Join unreadableHireDates with , and save it as unreadableNames.
ListsAdd the hire date of unreadableNames could not be read, so their work anniversaries were left out. Correct it in BambooHR. to the end of anniversaryProblems and save it as anniversaryProblems.Add the hire date of unreadableNames could not be read, so their work anniversaries were left out. Correct it in BambooHR. to the end of anniversaryProblems and save it as anniversaryProblems.
No
No steps
No
No steps
ListsSort anniversaries by date, smallest first and save it as anniversariesInOrder.Sort anniversaries by date, smallest first and save it as anniversariesInOrder.
ListsGet line from every item in anniversariesInOrder and save it as anniversaryLines.Get line from every item in anniversariesInOrder and save it as anniversaryLines.
ListsCount the items in peopleOut and save it as peopleCount.Count the items in peopleOut and save it as peopleCount.
ValuesSet outSummary to peopleCount people.Set outSummary to peopleCount people.
Decisions & LoopsIf peopleCount is 0If peopleCount is 0
Yes
ValuesChange outSummary to nobody has time off booked.Change outSummary to nobody has time off booked.
Else if @peopleCount is 1
ValuesChange outSummary to 1 person.Change outSummary to 1 person.
Otherwise
No steps
ValuesSet peopleSection to blank.Set peopleSection to blank.
Decisions & LoopsIf peopleCount is greater than 0If peopleCount is greater than 0
Yes
TextJoin personLines with a new line and save it as personList.Join personLines with a new line and save it as personList.
ValuesChange peopleSection to Change peopleSection to personList.
No
No steps
ValuesSet holidaySection to blank.Set holidaySection to blank.
Decisions & LoopsIf holidayLines isn't emptyIf holidayLines isn't empty
Yes
TextJoin holidayLines with a new line and save it as holidayList.Join holidayLines with a new line and save it as holidayList.
ValuesChange holidaySection to Change holidaySection to *Holidays* holidayList.
No
No steps
ValuesSet anniversarySection to blank.Set anniversarySection to blank.
Decisions & LoopsIf anniversaryLines isn't emptyIf anniversaryLines isn't empty
Yes
TextJoin anniversaryLines with a new line and save it as anniversaryList.Join anniversaryLines with a new line and save it as anniversaryList.
ValuesChange anniversarySection to Change anniversarySection to *Work anniversaries* anniversaryList.
No
No steps
Decisions & LoopsIf a step below fails, save the error as postErrorIf a step below fails, save the error as postError
Try
SlackSlackSend a message to slackChannelId. Save it as posted.Send a message to slackChannelId. Save it as posted.*Who's out this week (weekFrom – weekTo):* outSummary@peopleSection@holidaySection@anniversarySection
On error
Decisions & LoopsStop and report a problem: The message could not be posted to Slack (postError.message). Check that 'slackChannelId' at the top of the workflow is your team channel's ID, and for a private channel add the Lodol app to it by typing /invite Lodol in that channel.Stop and report a problem: The message could not be posted to Slack (postError.message). Check that 'slackChannelId' at the top of the workflow is your team channel's ID, and for a private channel add the Lodol app to it by typing /invite Lodol in that channel.
ListsCount the items in holidayLines and save it as holidayCount.Count the items in holidayLines and save it as holidayCount.
ListsCount the items in anniversaryLines and save it as anniversaryCount.Count the items in anniversaryLines and save it as anniversaryCount.
Decisions & LoopsIf anniversaryProblems isn't emptyIf anniversaryProblems isn't empty
Yes
TextJoin anniversaryProblems with Also, and save it as problemList.Join anniversaryProblems with Also, and save it as problemList.
Decisions & LoopsStop and report a problem: Posted who's out for weekFrom – weekTo (outSummary), but problemList.Stop and report a problem: Posted who's out for weekFrom – weekTo (outSummary), but problemList.
No
No steps
Decisions & LoopsFinish the run: Posted who's out for weekFrom – weekTo: outSummary; holidays: holidayCount; work anniversaries: anniversaryCount.Finish the run: Posted who's out for weekFrom – weekTo: outSummary; holidays: holidayCount; work anniversaries: anniversaryCount.