Sorting a datatable based on numbers stored as strings AND Add Data Row error

Just wondering, did you test this using an excel or csv file as input, because I noticed you are using a table with numeric values as input. From my experience, the Sort Data Table activity would look at the values as strings and therefore sort alphabetically. But, am willing to learn if there is a good way to sort the strings as numbers using that specific activity.

Here is one way I have sorted the table as an alternative @tkargee
Assign activity: dt1.AsEnumerable.OrderBy(Function(r) If(IsNumeric(r("columnname")), CDbl(r("columnname")), 0) ).CopyToDatable

Also, check out these search results on possible other similar methods: Search results for 'sort defaultview' - UiPath Community Forum

Regards.

4 Likes