# Read DataTable columns

**URL:** <https://forum.uipath.com/t/read-datatable-columns/258078>\
**Category:** Help\
**Tags:** system, activities\
**Created:** [September 24, 2020, 10:31am UTC](https://forum.uipath.com/t/read-datatable-columns/258078 "2020-09-24T10:31:57Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arettu63](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/arettu63/32/177094_2.png) [@Arettu63](https://forum.uipath.com/u/Arettu63)\
**Post date:** [September 24, 2020, 10:31am UTC](https://forum.uipath.com/t/read-datatable-columns/258078/1 "2020-09-24T10:31:57Z")

</div>

Hello all. I need help with DataTable columns  
I have DataTable like this:

Column0 Column1 Column2 Column3  
Mark Greg Sofa Alex  
23 25 30 22

I need reed name and then age, and write it in two fields in loop.  
I know how to write them in the fields, but i don’t understand how to loop through the DataTable

---

<div class="post-metadata">

**Author:** ![NIVED\_NAMBIAR](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/nived_nambiar/32/169066_2.png) [@NIVED\_NAMBIAR](https://forum.uipath.com/u/NIVED_NAMBIAR)\
**Post date:** [September 24, 2020, 10:33am UTC](https://forum.uipath.com/t/read-datatable-columns/258078/2 "2020-09-24T10:33:29Z")

</div>

Can u elaborate ur case better @Arettu63

---

<div class="post-metadata">

**Author:** ![Arettu63](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/arettu63/32/177094_2.png) [@Arettu63](https://forum.uipath.com/u/Arettu63)\
**Post date:** [September 24, 2020, 10:39am UTC](https://forum.uipath.com/t/read-datatable-columns/258078/3 "2020-09-24T10:39:38Z")

</div>

I have DataTable like this:

Column0 Column1 Column2 Column3  
Mark Greg Sofa Alex  
23 25 30 22

I need to take the second value from the first column (Mark) and write it in my form. Then take the third value from the first column (23) and write it in my form. I need to do this in a loop over all the elements.  
I know how to write in form, but i don’t understand how to access table elements

---

<div class="post-metadata">

**Author:** ![Mohsin\_Inamdar](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/mohsin_inamdar/32/133972_2.png) [@Mohsin\_Inamdar](https://forum.uipath.com/u/Mohsin_Inamdar)\
**Post date:** [September 24, 2020, 10:45am UTC](https://forum.uipath.com/t/read-datatable-columns/258078/4 "2020-09-24T10:45:48Z")

</div>

Hi @Arettu63

You have to use ForEachRow activity and within ForEachRow activity

Assign : Name\_Str = row.Item(“ColumnNameOf\_Name”).ToString  
Assign: Age\_Str = row.Item(“ColumnNameOf\_Age”).ToString

Thank You…

---

<div class="post-metadata">

**Author:** ![Arettu63](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/arettu63/32/177094_2.png) [@Arettu63](https://forum.uipath.com/u/Arettu63)\
**Post date:** [September 24, 2020, 10:56am UTC](https://forum.uipath.com/t/read-datatable-columns/258078/5 "2020-09-24T10:56:12Z")

</div>

if it is not difficult for you, you can write what the request will look like in first case ?

ForEachRow {  
Assign : Name\_Str = row.Item(“Column0”).ToString ??  
}

---

<div class="post-metadata">

**Author:** ![Srini84](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/srini84/32/464032_2.png) [@Srini84](https://forum.uipath.com/u/Srini84)\
**Post date:** [September 24, 2020, 11:24am UTC](https://forum.uipath.com/t/read-datatable-columns/258078/6 "2020-09-24T11:24:31Z")

</div>

@Arettu63

Refer below post for your reference  
[RPA DataTable: Get Previous Row Column Value, Set to Current Row Column Value - #2 by Latif](https://forum.uipath.com/t/rpa-datatable-get-previous-row-column-value-set-to-current-row-column-value/256199/2)

Also you can see more videos to get to know about the Datatable

Hope this helps you

Thanks

---

<div class="post-metadata">

**Author:** ![ppr](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ppr/32/464097_2.png) [@ppr](https://forum.uipath.com/u/ppr)\
**Post date:** [September 24, 2020, 8:48pm UTC](https://forum.uipath.com/t/read-datatable-columns/258078/7 "2020-09-24T20:48:29Z")

</div>

@Arettu63  
find starter help here:  
[ForEach\_AllCols\_TakeRowN-N+1.xaml](https://forum.uipath.com/uploads/short-url/i07HP1WkFYKaH9nLei1uAmecZPk.xaml) (7.8 KB)

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [October 15, 2020, 12:24pm UTC](https://forum.uipath.com/t/read-datatable-columns/258078/8 "2020-10-15T12:24:09Z")

</div>

Closed on October 15, 2020, 12:24pm UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
