Search code examples
blueprism

How to read today's day in Blue Prism? Example MONDAY


I would like to extract Date base on T-1 only for weekday which is Monday to Friday. Currently I have 2 separate bot running. First bot if today is Monday, it will capture last Friday's date. And second bot is for Tuesday-Friday.

How can I add calculation or decision, where If today=Monday then T-3 else T-1. I would like to maintain just 1 bot.

Any such calculation able to apply in blue prism?

Or any other suggestion?


Solution

  • You can use the built-in function called FormatDate.

    The function accepts two parameters, first being the date you want to format and the second being the date format: FormatDate("30 03 2020", "yyyy-MM-dd") returns 2020-30-03

    You can use the format to return only the weekday, for example:

    FormatDate("30 032020", "ddd") returns Mon

    or

    FormatDate("30 032020", "dddd") returns Monday