If you have DateTime that is (10-Aug-2019) you can use method of DateTime called DayOfWeek to store the value of the Day to a String, then check if that value is equal to Saturday of Sunday.
For Example try this > DateTime.Now.DayOfWeek.ToString >> it will give you monday
This will essentially fetch you the previous working day.
If you particulary need only Fridays, you can add an additional check to see .Dayofweek is Friday. Else loop again.
Pls Let me know if you have any queriesDecideT1.xaml (19.1 KB)
@ Sudhakar. I have created the below mentioned variables. Can you confirm its datatypes ?
tmpMinusOne (DateTime)
dateTminusOne (DateTime)
arrWeekDays (String)
listHolidays (?)
What should be the datatype for listHolidays? and do i need to make any changes further ?
tmpMinusOne (DateTime)
dateTminusOne (DateTime)
arrWeekDays (String array) – > You have {“saturday”,“sunday”} in this string variable
listHolidays (System.Collections.Generic.List) It is basically a holiday calendar that i have in the list(In case if my previous Friday is a public/regional holiday, bot should not be picking that date) If you do not require this check, you can remove that.
After Start i used assign which contains date.today(), followed by another assign for inputDateTime.Adddays(-1) which connects to decision (NOT a Saturday/Sunday).
For the above changes i am getting - System.Argument.OutOfRange.Exception
@Sudhakar based on the above T-1.xaml i have added ListOfHolidays excel file with header as ‘Holidays’ with input datas as
17-Aug-19
24-Aug-19
31-Aug-19
Added DataTable with single column as ‘Holidays’
Getting error as - System Argument Null Exception
Do i need to add anything else before running the file ?