Hi, I have an Excel, where the black lines are, are data entries. How do I do a read range so that when there is a row with no values, the rest of the rows below are not taken into account?
Thanks
Hi, I have an Excel, where the black lines are, are data entries. How do I do a read range so that when there is a row with no values, the rest of the rows below are not taken into account?
Thanks
Use this
Datatable.AsEnumerable.where(Function(row) row.ItemArray.All(function(col) not string.IsNullOrEmpty(col.ToString))).CopyToDataTable
Gives only the rows which are not empty
Cheers
Hello @Karan_Chauhan
You could read the range as normal, put an if at the very beginning of your loop and if all the columns are blank, simply exit the loop using a break.
Best,
Cam
Hi I don’t want to include rows below the empty row is what I am asking, there will only be one empty row so when this appears I don’t want to keep the rows underneath.
After reading the excel we can remove the empty rows
While reading the excel using read range activity how the bot knows which row is empty
Cheers
we do understand:
Assign Activity:
dtSmall =
dtOrig.AsEnumerable.TakeWhile(Function (r) r.ItemArray.All(Function (c) Not String.IsNullorEmpty(c.toString.Trim))).CopyToDataTable
But we can also implement with essential options like:
For each row in datatable
This error came up:
when filter result is empty, then we handle with
[FirstAid] Handling of The source contains no DataRows exception - News / Tutorials - UiPath Community Forum
but in that case it looks like a total empty datatable is sent to the processing
illustrations for above both:
AND
Variable: dtFiltered, Default/Init: dtData.Clone
CurrentRow.ItemArray.All(Function (x) String.IsNullOrEmpty(x.toString.Trim))