activities
latest
false
UiPath logo, featuring letters U and I in white
Workflow Activities
Last updated Nov 18, 2024

Filter Data Table

UiPath.Core.Activities.FilterDataTable

Enables you to filter a DataTable variable by specifying conditions in the Filter Wizard window. The activity can keep or delete rows or columns according to the logical conditions that are specified in the wizard. The body of the activity contains a Filter Wizard button so that you can access the wizard and customize your settings at any time.
Important: Due to internal changes, this activity is no longer be visible in the Favorites list when upgrading to v20.4 or newer, if it was added to the Favorites list with a v19.4 or older version of UiPath.System.Activities.

Project compatibility

Windows - Legacy | Cross-platform

Cross-platform configuration

Properties
  • DataTable - The DataTable variable that you want to filter. This field supports only DataTable variables.
  • Filter conditions - The conditions used to filter the data table by.

Advanced options

  • Action - Specifies whether to filter the table by keeping or removing the target rows.
  • Filtered data table - The resulting filtered data table.
  • First row - The first row of the data table that matches the configured filters.



Windows - Legacy, Windows configuration

Properties
Common
  • DisplayName - The display name of the activity. This field supports only strings or String variables.
Input
  • DataTable - The DataTable variable that you want to filter. This field supports only DataTable variables.
Misc
  • Private - If selected, the values of variables and arguments are no longer logged at Verbose level.

Options

  • FilterRowsMode - Specifies whether to filter the table by keeping or removing the target rows. Select one of two options from the drop-down menu: Keep or Remove. The default value is Keep.
  • SelectColumnsMode - Specifies whether to filter the table by keeping or removing the target columns. Select one of two options from the drop-down menu: Keep or Remove. The default value is Keep.

Output

  • DataTable - The resulting filtered DataTable variable. Using the same variable as the one in the Input field overwrites the initial variable, while adding a new variable leaves the initial one unaffected. This field supports only DataTable variables.
    Note:
    • If you copy and paste a customized Filter Data Table activity inside the Designer panel, it does not retain its configuration.
    • Excel ranges are not supported as input for this activity.
Filter Wizard
This wizard helps build the filtering options for a DataTable variable. It can be opened by using the Filter Wizard button in the body of the activity in the Designer panel. You can select the DataTable you want to modify as well as the one you want to save changes in, from the following fields:
  • Input Data Table - The DataTable variable you want to filter. This field supports only DataTable variables.
  • Output Data Table - The output DataTable variable. If the same variable that is present in the Input field is used, it is overwritten with the changes. Supplying a different variable does not modify the Input variable.

You can also select whether to filter by Row or by Column depending on the tab you select. There are two tabs, as follows:

Filter Rows Tab Field Descriptions
The Filter Rows tab enables you to filter a DataTable by Rows. To do so, you have the following options:


  1. Keep or remove matching rows - Specifies whether to filter the rows by keeping or removing them. This can be done by selecting the Keep or the Remove radio buttons. Selecting Keep only keeps the rows that meet the specified condition, while selecting Remove removes the rows that meet the specified condition.
  2. And/Or - Specifies the logical conjunctions to be used between conditions. This button is displayed only if you have more than one condition. By default, when you add a new condition, the button is displayed as And. Click the button to change its value to Or.
  3. Column - The name or index of the column that is to meet the condition.
  4. Operation - The logical condition that is to be met between the Column and the Value.
  5. Value - The value that is to be checked with the Operation and the Column.
  6. Add/Remove Condition - Clicking the + button adds another sentence to the condition, while clicking the x button removes a sentence.
    Note: When supplying a variable in the Column text box, you can use an Int32 variable to specify the column index, or a String variable to specify the column name.
Output
The Output Columns tab enables you to filter a DataTable by Columns. To do so, you have the following options:


  1. Columns Selection Mode - Specifies whether to filter the columns by keeping or removing them. This can be done by selecting the Keep or the Remove radio buttons. Selecting Keep only keeps the columns that are specified below, while selecting Remove deletes the rows that are specified below from the input DataTable.
  2. Column - The columns you want to keep or remove from the DataTable.
    Note: When supplying a variable in the Column text box, you can use an Int32 variable to specify the column index, or a String variable to specify the column name.
  3. Add/Remove columns - Clicking the + button adds another column, while pressing the x button removes the column.
    Note: The order you add columns in the Wizard is the order that the columns are arranged in the output table.

Example of using the Filter Data Table activity

Here you can see how the Filter Data Table activity is used in an example that incorporates multiple activities.

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.