Delete Empty Row Output

Hello guys !
so i tried to print value from datatabe
image

but i got two result the first one is empty and the second one is the right value
image

can you guys help me to delete that empty output
so the output should be
image

thank you

1 Like

Put a filter datatable as to remove the blank spaces!!!

Easy way :blush:

3 Likes

Fine
Before this writeline activity
—use a if condition like this
Not String.IsNullOrEmpty(row(“ItemUnitPrice”).ToString)

If true it will go to THEN part where we can have our writeline activity and mention the output
So that it won’t display empty output
row(“ItemUnitPrice”).ToString

Cheers @Aluneth_X

1 Like

@Aluneth_X
You can use select method to remove empty row
Like
Datatable.select(columnname != " ")

2 Likes

Good morning Aluneth,

Just to throw out a different (but similar to the ones above) approach.

If you ever want to remove all empty rows from your datatable, you can use the following code in an assign stage:

DataTableName=DataTableName.Rows.Cast(Of DataRow)().Where(Function(row) Not row.ItemArray.All(Function(field) field Is DBNull.Value Or field.Equals(""))).CopyToDataTable()

3 Likes

best solution

1 Like