I have an issue when I want to select a datarow from a “build data table” activity.
I buil a data table with 2 columns : Date(string) and Price(string)
I get information from a MainFrame : Date and Price
I store them into string variables : Date1, Price1, Date2, Price 2, and so on…
date output is for example : 03.09.2018 etc
I have had Add Data Row to put the variables into the datatable
Then I need to choose only the price with the most recent date.
I tryied this formula :
Assign : str_RecentDate : dt_DatePv.AsEnumerable.Select(Function ( r ) r(1).toString.Trim).OrderBy(Function (s) DateTime.ParseExact(s, “dd.MM.yyyy”, System.Globalization.CultureInfo.CurrentUICulture.DateTimeFormat)).Last()
But I have an error message :
Assign : The string was not recognized as a valid DateTime.
@najoua.abbaci
for any reasons a string is sent to the datetime,parseexact that is not in the expected format. Here a debugging is helping for inspecting the content of the datatable.
I’m sorry if my answer is not what you expect, coz i’m a rookie in UiPath (and in dev)
I have two columns in my datatbale : one : Date(stringtype), another one : Price (string)
I collect the information from a MainFrame with Get text and the result return a string.
the FindNotMatchingDateFormatDates seems to work because i don’t have any error message.
But How can I check if it is the right date ?
Can you please tell me what should i put on the Write line or Log message to got it ?
Sorry but can you help me with another issue.
Now that I find the recent date in my datatable, i need to store in a variable the price link to this date.
My dt_DatePv is like this
Date1, PV
01.03.2010, 0.45
04.08.2020, 1.45
etc etc
I need to select the price with the most recent date.