Hi need to create a trigger which should run on every 3rd weekday of a month at 10:00 AM. How can i write it?

Hi ,

I need to create a logic in the code were the bot should run on the 3 business day of the month so can anyone please help me to resolve it.
As through crone expression we cant achive it as it will run to the nearest working day if 3 falls on weekend

Can you try CronMaker and use Time Trigger → Advance and put the Cron expression there.

CronMaker

@vishal_nachankar

Please try this

Schedule the bot to run on 3 to 5 …only these can be 3rd working days

then before starting anything first check if the current day is 3rd working day

Enumerable.Range(1, DateTime.DaysInMonth(year, month)).Select(Function(day) New DateTime(year, month, day)).Where(Function(date) date.DayOfWeek <> DayOfWeek.Saturday AndAlso date.DayOfWeek <> DayOfWeek.Sunday).ElementAt(2)

this gives 3rd working day of any month depending on year and month you provide…check if today is this day and run if yes else end process

cheers

sorry i didnt get it can you explain step by step…i didnt get what exactly need to be followed??

@vishal_nachankar

  1. Schedule the bot to run on 3rd 4th and 5th of month
  2. In Process in the initialization state use a if condition and first check if the current date Now.ToString("MM/dd/yyyy").Equals(Enumerable.Range(1, DateTime.DaysInMonth(Now.year, Now.Month)).Select(Function(day) New DateTime(now.year, Now.month, day)).Where(Function(date) date.DayOfWeek <> DayOfWeek.Saturday AndAlso date.DayOfWeek <> DayOfWeek.Sunday)(2).ToString("MM/dd/yyyy"))
  3. On true side use a bool and set to true to run bot and on else side set to false and do not run the bot

cheers

cheers

Thanks let me try and update thanks for the help

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.