Could someone help me with this? It's urgent

Hello @anjasing ,

Change the if condition like this:
row(“Description”).ToString.Length > errorDescription.Length


1 Like

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.

1 Like

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)


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
1 Like

Thank you so much. That was a biggg help :slight_smile:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.