How to set condition base on date & weekday?

Dear Experts

I have a request as below

  1. If now.date=Monday and (now.date<>2024/5/7 or now.date<>2025/1/6) and now.currentTime>=8:30 and now.currentTime<=8:50, set as “1-1 Trigger”
  2. If now.date=(Tue/Wed/Thu/Fri) and (now.date<>2024/5/7 or now.date<>2025/1/6) and now.currentTime>=8:30 and now.currentTime<=8:50, set as “1-2 Trigger”
  3. If now.date=(Mon/Tue/Wed/Thu/Fri) and now.currentTime>=12:30 and now.currentTime<=12:50, set as “2nd Trigger”
  4. If now.date=(Mon/Tue/Wed/Thu/Fri) and now.currentTime>=16:30 and now.currentTime<=16:50, set as “3rd Trigger”
  5. If now.date=2024/5/7 and now.currentTime>=8:30 and now.currentTime<=8:50, set as “Labor Day Trigger”
  6. If now.date=2025/1/6 and now.currentTime>=8:30 and now.currentTime<=8:50, set as “New Year Trigger”

Previously I already work out logic base on time condition. But I don’t know how to set it by date and weekdate together with time condition

The reason they set them is that:

  1. The process won’t run in weekend or Labor Day Holiday(4/27~5/6) or New Year Holiday(2024/12/28~2025/1/5)as request
  2. When its Monday, it need to get last Friday file. Like “0520-1.xlsx” need to use “0517-3.xlsx” for vlookup
  3. When its 5/7(after Labor Day Holiday), it need to get 4/26 file. Like “0508-1.xlsx” need to use “0426-3.xlsx” for vlookup
  4. When its 1/6(after New Yea Holiday), it need to get 12/27 file. Like “0106-1.xlsx” need to use “1227-3.xlsx” for vlookup

May I know how to make it happen when we need to consider date?

Thank you for your advise in advance

Regards

@yangyq10,

I think you should be using Holiday calendar instead of hardcoding these dates. Next year the date’s going to be changed so your trigger and bot going to break.

if you are setting trigger use Orchestrator Holiday Calendar.
If you want to compare date use a excel file with all holidays as Holiday calendar.

Thanks,
Ashok :slight_smile: