Hello @anjasing ,
Change the if condition like this:
row(“Description”).ToString.Length > errorDescription.Length
Thanks!
If your data table is called dt
you can get the longest description with an Assign activity:
longestDescription = dt.AsEnumerable.OrderByDescending(Function(r) r("Description").ToString.Length).First()("Description").ToString
longestDescription is a string.
Hi, your code was useful, Can you help with one more thing. In the below table if I just want to extract cell value with status as Error only and then having greatest characters in Description then print only description of that cell value? SOrry for the inconvenience. That would be great help
SampleExcel.xlsx (9.3 KB)
Hi!
Change the expression to the following if you only want the longest error description:
longestErrorDescription = dt.AsEnumerable.Where(Function(x) x("Status").ToString.Trim.Equals("Error")).OrderByDescending(Function(r) r("Description").ToString.Length).First()("Description").ToString
Thank you so much. That was a biggg help
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.