How to remove empty rows from table in UiPath

In this article, we will walk through the steps to remove empty rows in a table in UiPath.

Goal: Remove empty rows from dataTable

Step-by-step solution

  1. Drag and drop the ‘Filter Data Activity’ into your workflow
    image

  2. At DataTable field, input the name of your dataTable

  3. Click on Configure Filter button

image

  1. After clicking ‘Configure Filter’, the Filter Wizard window will pop up
  • Select ‘Remove’ radio button as we are removing rows from the table
  • In Column field, input column number (if first column number, then input 0, second column, input 1, etc.)
  • In Operation field, select ‘Is Empty’

  1. After closing the ‘filter wizard’, we need to tell UiPath what variables to save our filtered dataTable. You can put our input dataTable in this field to ‘update’ our original table.

image

2 Likes

Below Query will remove empty rows from data table.

Assign dt = dt.AsEnumerable.Where(Function(row) Not row.ItemArray.All(Function(field) field Is DBNull.Value Or field.Equals(“”))).CopyToDataTable

Hi @indra

Yes, we can also use LINQ query to get the same result.

1 Like