# For Each Row in Data Table

> `UiPath.Core.Activities.ForEachRow`

`UiPath.Core.Activities.ForEachRow`

## Description

Executes an action once for each row in a specified `DataTable` variable.

## Limitation

The **For Each Row in Data Table** activity does not support persistence in child activities.

To overcome this limitation, use a regular **For Each** activity with numbers to go through each row by its index:

1. Set the loop to go from 1 to the number of rows in your table:
   ```
   Enumerable.Range(1, dataTable.RowCount).ToList()
   ```
2. Inside the loop, access the row by its number:
   ```
   dataTable.Rows(currentNumber)
   ```
   :::important
   Always access a row by its number rather than storing the current row in a variable.
   :::

## Project compatibility

**Windows - Legacy** | **Windows** | **Cross-platform**

## Cross-platform configuration

* **DataTable** - The `DataTable` variable for which an action is to be executed once for each row.
* **Item** - The name used to reference each row in the contained activities.
* **Body** - Activities to be executed for each row are placed here.

## Windows - Legacy, Windows configuration

#### **Designer panel**

* **For Each** - The name used to reference each row in the contained activities.

#### **Properties panel**

#### **Common**

* **DisplayName** - The display name of the activity.

#### **Input**

* **Condition** - This condition applies to the entire loop. If set to **False**, the body of the activity does not execute.
* **DataTable** - The `DataTable` variable for which an action is to be executed once for each row.
* **MaxIterations** - Input the number of times the loop should execute.

#### **Misc**

* **Private** - If selected, the values of variables and arguments are no longer logged at Verbose level.

**Output**
* **Index** - A zero-based index that specifies what element of the current collection is being iterated, stored in an `Int32` variable.

## Example of using the For Each Row in Data Table activity

[Here](https://docs.uipath.com/activities/other/latest/workflow/remove-data-row-column) you can see how the **For Each Row** activity is used in an example that incorporates multiple activities.
