I am trying to find out if the date in a cell is between todays date and 30 days time.
I have 2 columns. Column A is a list of names and the Column B is a list of dates.
If the date in the cell of column B is between these 2 dates then I want to extract the information from both columns in that row.
I am new to UIPath and struggling to work out how to do it.
Any help is much appreciated.
Assuming your date is in format dd/MM/yy
Assign TodayVar = Date.ParseExact(Now.tostring(“dd/MM/yy”),“dd/MM/yy”,system.Globalization.DateTimeFormatInfo.InvariantInfo)
Assign 30DayVar = Date.ParseExact(Now.AddDays(30).tostring(“dd/MM/yy”),“dd/MM/yy”,system.Globalization.DateTimeFormatInfo.InvariantInfo)
Read your 2 columns into a datatable
For Each Row in yourDatatable:
Get Row Item: col index 1, output yourDateString as string
Assign yourDate = Date.ParseExact(yourDateString,“dd/MM/yy”,system.Globalization.DateTimeFormatInfo.InvariantInfo)
If: yourDate>TodayVar AND yourDate<30DayVar (if you want to count dates that are the same as 30DayVar as well then change accordingly)
Then Continue with workflow
Else Throw
Thank you every one, your help was much appreciated and gave me the start I was looking for.