How to get value in last row in first column. Very important

Please help! It is very important.
I vave Dt. If in cell in last row in first column empty - I need filter me DT(delete last row)
If not empty -not change

1 Like

you need to get last row value in firstcolumn?

1 Like

Hi @RPA3

Hi Just count the Datatable and issue the command Deleterows activities and pass the count of the datatable for you to check the last row.

cheers :smiley:

Happy learning :smiley:

1 Like

@RPA3 in if Activity use DT(DT.Rows.Count-1)(0).toString.isNullOrWhitspace , If True Filter the DT, Else Leave it Empty , I guess this is What you needed :sweat_smile:

1 Like

hi @supermanPunch
( readedValue.Rows.IndexOf( readedValue.AsEnumerable.Where(Function(r) r(“ColumnName”).ToString.Trim <> “”).ToArray.Last ) + 2 ) this function retrieve the number of rows from your column, just check if the last row have any value or not.
Regards!

1 Like

yes, it true

It is not work for me:(

@RPA3 Did you get any Error?

1

lastValueinRow.xaml (7.5 KB)
cheers @RPA3

@RPA3 it is DT(DT.Rows.Count-1)(0).toString :sweat_smile:

1 Like

wow, it is great :смеющийся:

1 Like

But DT(DT.Rows.Count-1)(0).ToString.isNullOrWhitspace

isNullOrWhitspace - not work

@RPA3 try this DT(DT.Rows.Count-1)(0).toString.isNullOrEmpty

1

@RPA3 Check this String.IsNullOrEmpty(DT(DT.Rows.Count-1)(0).toString) :sweat_smile:

same error

I use this to read the column i want with the Read Range Activity.

image

You wanted to print it in write line, but it gives you boolean value. So u need to put in write line with value:

(String.IsNullOrEmpty(DT(DT.Rows.Count-1)(0).toString)).toString

Then u should get true/false

And when u get it u can just put if to the workflow with:

String.IsNullOrEmpty(DT(DT.Rows.Count-1)(0).toString)

and in yes path just put remove data row with this dt in the value and rowindex= DT.Rows.Count-1