Fetch only last 3 rows from an excel

In UiPath how to get only last 3 rows from an excel.
Can anyone help me on this? Your solution would really helps me

@Steven_ds_55
filteredDT = yourDT.AsEnumerable().Skip(Math.Max(0, dtData.Rows.Count - 3)).CopyToDataTable()

hope it helps!!

3 Likes

Hey @Steven_ds_55 replace build data table with read range activity use assign activity and the variable which hold the last row is of Datatable. so it will store last 3 row data

@Steven_ds_55

If using model excel activities

Then excel.sheet("Sheetname").rowcount will give you the count

Which can be used in reqd range to read only last 3 rows

Cheers

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