Suggest a expression to get it
Welcome to UiPath community
Hope this would help you
TestDt.AsEnumerable().Select(Function(x) x.Field(Of String)(“YourColumnName”).Trim).ToArray().Where(Function(y) Not String.IsNullOrEmpty(y)).ToArray().Count
Hi @Viswanathan_M, welcome to the Community.
You can convert the specified row into an array and take the count of the elements, which gives the number of rows present in the column.
Hope this helps,
Hi @Viswanathan_M ,
Ideally all the columns in a Datatable will have the same row count, So we directly use the below :
But if the intention is to get only the Non-Empty rows Count in a column, then we can use the below Expression :
The above is also when you only have empty values in the end of the column.
Got the Solution its working fine Thanks Palaniyappan.
Glad it got resolved @Viswanathan_M
I am interested in Learning this expression, from where did i learn this expression.
Have a view on this for more details on accessing datatable
Thanks for providing solutions on forum.
This expression is not working for empty rows in data table, mean count 0 it’s not working.
First check whether the datatable has records in it before using the linq query with a simple IF condition
have to check only if that particular column has records. because other columns having records and hence data table will obviously say that has records.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.