Get top N rows from a datatable

Hi All,
I have a datatable which has around 500 records at any point of time.
The business requirement is to process only 200 records from that datatable at any point of time.

I found the following query to get top N rows out of a datatable but Cast doesnt seem to work in UiPath.
dt2 = dt.Rows.Cast<System.Data.Datarow>.Take(n).CopyToDatatable.

Any other way these could be done?

Thanks

@ankwoods, Refer this, An Existing Solution

Regards,
Dom :slight_smile:

4 Likes

Thanks Dominic. Somehow this article skipped my feed.