ForEachRowinDataTable

Estimated reading: 4 minutes

The For Each Row in DataTable activity iterates through each row in a specified DataTable and executes the activities placed inside its Do container. The activity includes a built-in Filter Wizard to filter rows before processing and a Max Iterations property to limit the number of rows processed during execution.

Activity Designer Options

DataTable: Specify the source DataTable to iterate through.

Item Name: Specifies the variable name that represents the current row during iteration.

FilterWizard: Opens the Filter Table Wizard for configuring row filtering and column selection rules.

Filter Rows: Defines the conditions used to include or exclude rows from the DataTable before iteration.
Keep: Processes only the rows that match the configured conditions.
Remove: Excludes the rows that match the configured conditions.

Column: Specifies the column name or index to evaluate. Default: CurrentRow

Operation: Specifies the condition used to compare the selected column value against a specified value when filtering rows.

  • Less Than (<): Matches rows where the column value is strictly less than the specified value.
  • Greater Than (>): Matches rows where the column value is strictly greater than the specified value.
  • Less Than or Equal (<=): Matches rows where the column value is less than or equal to the specified value.
  • Greater Than or Equal (>=): Matches rows where the column value is greater than or equal to the specified value.
  • Equal (=): Matches rows where the column value is equal to the specified value.
  • Not Equal (!=): Matches rows where the column value is not equal to the specified value.
  • Is Empty: Matches rows where the cell value is blank or null (no comparison value required).
  • Is Not Empty: Matches rows where the cell contains any value (no comparison value required).
  • Starts With: Matches rows where the text value begins with the specified string.
  • Ends With: Matches rows where the text value ends with the specified string.
  • Contains: Matches rows where the specified substring appears anywhere within the text value.
  • Does Not Start With: Matches rows where the text value does not begin with the specified string.
  • Does Not End With: Matches rows where the text value does not end with the specified string.
  • Does Not Contain: Matches rows where the specified substring does not appear anywhere within the text value.

Do: Container where activities are added and executed for each row.

Properties

Input

DataTable: The source DataTable to iterate through.

MaxIterations: Specifies the maximum number of rows to process. Iteration stops automatically when this limit is reached.

MISC

DisplayName: Specifies the display name of the activity in the workflow designer.

SkipOnError: Specifies whether workflow execution continues when the activity encounters an error.
True: Continues workflow execution when an error occurs.
False: Stops workflow execution when an error occurs.
None: Uses the default value, False.

Version: Displays the version of the DataTable Automation package being used.

Output

Index: Returns the zero-based index of the current row being processed.

Result: Returns a Boolean value indicating the activity’s execution status.
True: The activity executed successfully.
False: The activity failed due to an unexpected error.

How It Works

1. The For Each Row In Data Table activity accepts a source DataTable and creates a row variable using the configured Item Name.
2. Before iteration begins, the activity applies any rules configured in the Filter Wizard.
3. The filtered DataTable becomes the source for iteration.
4. The activity processes rows sequentially and exposes the current row through the configured row variable (for example, CurrentRow).
5. Activities inside the Do container are executed for each processed row.
6. If Max Iterations is specified, the activity stops processing once the configured iteration limit is reached.
7. During execution, the Index output is updated with the current row position.
8. If the DataTable is empty, null, or no rows match the filter conditions, the activity completes without executing the Do container.
9. The activity returns its execution status through the Result output property.

Example

To process only active customer records and limit processing to the first 100 matching rows:

1. Provide a populated customer DataTable.
2. Add the For Each Row In DataTable activity to the workflow.
3. Assign the customer DataTable to the DataTable property.
4. Keep the default Item Name value of CurrentRow.
5. Open Filter Wizard and configure the following:
Column: Status
Operation: Equals (=)
Value: Active
Rows Filtering Mode: Keep
6. Set Max Iterations to 100.
7. Add the required activities inside the Do container using values such as CurrentRow

During execution, the activity filters the DataTable to include only active customers, processes the matching rows sequentially, executes the activities in the Do container, and stops after processing 100 matching rows or when no additional matching rows remain.

Share this Doc

ForEachRowinDataTable

Or copy link

CONTENTS
Robility Chatbot
Robility Assistant
Online