How to take first four row in datatable

I need to take first four row in datatable in uipath if the datatable has 4 rows leave it like that if it has more than 4 rows take only first four row

Hi,

Can you try the following using Assign activity?

dt = dt.AsEnumerable.Take(4).CopyToDataTable

Regards,

Hi @sruthesanju

You can use if condition (row count >4) and the use the assign activity. It should work.

Hello,

Please refer to the below post or simply use the method @Yoichi suggested.

image