Community blogs
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results forÂ
Here is one approach to creating a holiday booking workflow that excludes weekends and bank holidays. The logic of this workflow is based on creating a collection variable containing the date range of the requested holiday dates, a collection containing the bank holidays and then checking these dates against each other to filter out the bank holidays. The key to this working is enforcing the date formats throughout the workflow.
STEP 1: Create a custom list called HolidayBooking with 2 date columns for DateStart and DateEnd. The end user will use the DateStart and DateEnd to define the duration of their holiday.
STEP 2: Create a list workflow on the HolidayBooking list with the following variables:
STEP 3: Create a collection called varColBankHol containing the bank holiday dates. These dates will eventually be excluded from the requested date range.
Example: The Bank Holiday collection (varColBankHol) looks like this: 02/05/2016;30/05/2016;29/08/2016;26/12/2016;27/12/2016 |
---|
STEP 4: Add the start date and end date as variables.
STEP 5: Create a collection called varColRequestedDates containing the range of requested holiday dates ensuring they are formatted as dd/MM/yyyy. After the loop add the end date to the varColRequestedDates collection.
Example: The resulting collection (varColRequestedDates) based on a start date of 27th May 2016 and an end date of 2nd June 2016: 27/05/2016;28/05/2016;29/05/2016;30/05/2016;31/05/2016;01/06/2016;02/06/2016; We next need to filter out the weekends and bank holidays from this range. 28/05/2016 & 29/05/2016 are weekend dates and 30/05/2016 is a bank holiday. |
---|
STEP 6: Remove weekends from the varColRequestedDates collection of requested dates.
Value: fn-FormatDate(varDate1, "dddd")
does not begin with
S
Example: The resulting collection (varColBusDates) with the weekend dates removed: 27/05/2016;30/05/2016;31/05/2016;01/06/2016;02/06/2016; We removed 28/05/2016 & 29/05/2016 from the collection. |
---|
STEP 7: Now we have a collection variable containing a range of dates that excludes weekends. We now need to exclude bank holidays.
Workflow Data: varYNExists
equals
Value: Yes
Value: fn-FormatDate(varDate1, "dd/MM/yyyy")
equals
Value: fn-FormatDate(varDateEnd, "dd/MM/yyyy")
Example: The resulting collection (varColBusDates) with the bank holiday dates removed: 27/05/2016;31/05/2016;01/06/2016;02/06/2016; We removed 30/05/2016 from the collection. |
---|
We now have a collection of dates based on a date range specified by the user that excludes weekends and bank holidays.
Mitch
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.