Get last row in dataTable

Hi guys,

Please read my question before responding.

How can i get the last row of a datatable without using this:

mylastrow=mydatatable.rows(mydatatable.rows.count-1)

Is it possible the call the function itself inside (this, self or idk)?

ty

Does this work for your needs @Elya?

in uipath you have two option to access a row, inside a loop like for each row, or using an assign like you have above…

Hi @Elya , I typically just store this in a separate xaml file if I want to call it on multiple places, similar as you would a function. Pass arguments in and out to achieve this. Seems your question is a bit more geared towards a more OOP approach, curious if it is doable in RPA as well.

Give a try on
mydatatable.AsEnumerable().last()

3 Likes