Hi All,
I am working on web application where i need select Month,Date and Year based on the day.
Eg : if day is Tuesday i need to pass the Previous day deatils (Previous day Month,Year and Date)
and if I am running bot on Monday i need to pass starting date as Friday date with Current month of the friday date and Current year of the friday date and end date will be sunday with Current month of the Sunday date and Current year of the Sunday date. screen shot as below
Hi, @ManjuNarasappa
To select Month, Date, and Year in UiPath based on the “previous day” logic:
Use:
previousDay = If(Now.DayOfWeek=DayOfWeek.Monday, Now.AddDays(-3), Now.AddDays(-1))
monthName = previousDay.ToString("MMM")
dayNum = previousDay.Day.ToString
yearNum = previousDay.Year.ToString
Use these variables with Select Item/Type Into in dropdowns.
If today is Monday, also set:
Friday = Now.AddDays(-3)
Sunday = Now.AddDays(-1)
Use Friday/Sunday values as needed for your web fields
Hi @arjun.shiroya I am getting below error, I took previousDay DataType as DayOfWeek and For Year variable also same issue
Change the variable type to DateTime. Only DateTime supports .Day, .Month, .Year, and .ToString(“MMM”).
After changing, your assignments will work without error

