In the above date calender,
If the “No reference rate found” is found then, the calender should pick date of the month before date, if again it should it should take again before date how to do it.
Could you elaborate further.
Use CheckAppState activity to check “No reference rate found” and if found then
use assign activity like below to get previous month date.
PreviousMonthDate = DateTime.Now.AddMonths(-1).ToString
if possible use type into in Date input box.
for eg., according to the logic it takes 31 st march as date if the popup appears as “no reference found” then it should pick 30th march. again if the popup appears it should pick 29th. it shoud not consider sat and sun. If it is sat or sun then it should take before date
Hey @anjani_priya
Please try this!
- Add a do while loop.
- Add selecting the date part inside the loop and extract the text below From Date.
finalDate = New DateTime(Now.Year, Now.Month, 1).AddDays(-1) - After that add a if condition and check whether the text you extracted is same as No Reference Rate Found.
- If that is same then decrement the date inside the if condition and assign to the date variable.
Note: You can change the if condition in such a way that if that particular date is sat or sun it will consider the previous day.
finalDate = DateTime.Parse(finalDate).AddDays(-1).ToString()
Add one more if statement with the condition DateTime.Parse(finalDate).DayOfWeek = DayOfWeek.Saturday OrElse DateTime.Parse(finalDate).DayOfWeek = DayOfWeek.Sunday
If this is true then again decrement the date
finalDate = DateTime.Parse(finalDate).AddDays(-1).ToString()
Here the finalDate is String variable
- For the do while loop add a condition saying extracted text is not equal to No Reference Rate Found.
So this will decrement the date untill the extracted text does not contain No Reference Rate Found.
Hope this helps!
Check app state on No Reference Rate Found .
Use while loop with boolean variable
if condition DateTime.Parse(inputDateString).DayOfWeek = DayOfWeek.Saturday OrElse DateTime.Parse(inputDateString).DayOfWeek = DayOfWeek.Sunday
Assign inputDateString = DateTime.Parse(inputDateString).AddDays(-1).ToString()
Else:
and
CheckWeekEnd = False
Hope this helps!