cancel
Showing results for 
Search instead for 
Did you mean: 

Check if Today() is a working day

MartaGelea
Level 2

Hello!

I need some help to create a VBO which verify if Today() is a working day without using the Calendars VBO of Blueprism.

Any ideas?
Thank you!

1 BEST ANSWER

Helpful Answers

John__Carter
Staff
Staff
Do you mean something like InStr("Monday Tuesday Wednesday Thursday Friday", FormatDate(Today(), "dddd"))>0

Or do you mean 'check if today is a national holiday'? You could look for an API such as https://www.gov.uk/bank-holidays.json, and I've seen (complex) spreadsheets for UK holidays but have never used one.

View answer in original post

3 REPLIES 3

John__Carter
Staff
Staff
Do you mean something like InStr("Monday Tuesday Wednesday Thursday Friday", FormatDate(Today(), "dddd"))>0

Or do you mean 'check if today is a national holiday'? You could look for an API such as https://www.gov.uk/bank-holidays.json, and I've seen (complex) spreadsheets for UK holidays but have never used one.

JohnCowell
Staff
Staff
If you wanted to expand on this idea (and you are comfortable with using code stages) you could use something like Nager.Date to check for holidays and weekends. The description on the Github site (https://github.com/nager/Nager.Date) says it currently supports over 100 countries. There's also a WebAPI avaiable. This package is available via nuget and you can build/test it first using a small VS project. From a BP code stage you can then build a small amount of code that uses the Nager.Date.dll. For example, pass in a date and see if it is a holiday or weekend date. I've given this a quick test and it works fine within a code stage.

Hope this helps.

DISCLAIMER: The recommendation for the use of "Nager.net" is done with the intention of offering a helpful resource. Blue Prism cannot endorse, approve or guarantee software, or the related information and services provided by this or other third-party resources. As such, Blue Prism is not responsible for the content or accuracy of any third-party resource or for any loss or damage resulting from the use or failure of products or services provided by a third-party resource. When using a third-party resource, you will be subject to the terms and licenses by that resource, and no longer be protected by Blue Prism privacy policy or security practices. The third-party resource license and use of terms should be reviewed, including privacy policy and security practices, prior to their use.
John Cowell Senior Software Support Analyst Blue Prism

BrentonWestwood
Level 5
My team, which included @Dave Morris, created a reusable action to evaluate the given day.    This action used a Blue Prism Calendar that was setup for the department​ that defined the Public Holidays that the department recognizes and any 'Other Holidays' such as the day after Thanksgiving.   With the calendar updated yearly (kept up-to-date for any 'Other' holidays that need to be defined), the calendar object can be used to determine if the given day is a Holiday (Public or Other defined holiday).    If not, the Calendar - Is Working Day action can be called to determine if the day is a working day as defined in the System - Calendar you create (you can define what days of the week are "working days").     So, I suggest reviewing the System - Calendar options and reviewing the help for the build in Blue Prism Calendars object.    Using these "tools" you should be able to do what you need to do.