How extract only last index data from the excel

Hi I need to extract only the last index of data [name, email_id, phone_No]
I need to extract all the things

Example: datatable.rows.index value= 5
I need to extract the 5th index of the data table
[name, email id, phoneno]

I hope I will get a replay soon

Thanks
Chethan P

Hi @copy_writes

In read range activity give range as “A5:C5”

or

after read the whole data
in assign
dtTable = dtTable.AsEnumerable().Reverse().CopyToDataTable.AsEnumerable.Take(1).CopyToDataTable

2 Likes

you can get the total count of the Datatable.

then to get your last row details, row(totalcount-1).xxxxxx

hope it helps :slight_smile:

1 Like

@copy_writes

varDT.rows(varDT.rows.count-1)("Name").ToString
It will give you Name from last row of data table

Likewise, just change the column name to get other values…

1 Like

Thanks for the fast response @prasath_S @wilson.yan I will check
And in my forum Am not able to see the new topics @Pravin_Patil1
Please help.

Thanks
Chethan P

@copy_writes

I’m not sure, I can see but the numbers are reduced from 75 to 3 just in minute…

Also, Mark relevant comment as solution and close the thread

Sure
am not seeing that 3 also

How to print phone no and email_id in single code sulli use vardat.rows(rows.count-1)(Name)(phone)…tostring like this or we nedd to write the suparate code

Thanks
Chethan P

varDT.rows(varDT.rows.count-1)("Name").ToString

varDT.rows(varDT.rows.count-1)("email_id").ToString

varDT.rows(varDT.rows.count-1)("phone_No").ToString

Actually i need in the single code its ok

It is also working thank you very much but without a loop, we need to print

Thanks
Chethan P

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