bot runs every Thursday how to find if its last Thursday or not
Get last Thursday by using the below code inside an Assign:
DateTime lastThursday = DateTime.Now.AddDays(-1);
while(lastThursday.DayOfWeek != DayOfWeek.Thursday){
lastThursday = lastThursday.AddDays(-1);
}
what we need to do for sunday
so i just need to replace thursday by sunday right
Yes, try it and let me know if you are facing any issues.
Okay, what is your requirement? You want to fetch previous Sunday’s date?
actually bot will run everyday if its last sunday of the month then it will send an email
eg. if bit is running today then it will checkif its not the last sunday of current month
if its sunday and last sunday then it will send an email if its not it wont do anything
To achieve that, you simply need to use the below expression inside an if condition:
DateTime.Today.DayOfWeek.ToString = "Sunday"