# Issue in Data Table

**URL:** <https://forum.uipath.com/t/issue-in-data-table/285241>\
**Category:** Help\
**Tags:** datatable, question, studio, orchestrator, system, activities\
**Created:** [January 22, 2021, 8:15am UTC](https://forum.uipath.com/t/issue-in-data-table/285241 "2021-01-22T08:15:56Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![amitkk\_84](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/amitkk_84/32/177094_2.png) [@amitkk\_84](https://forum.uipath.com/u/amitkk_84)\
**Post date:** [January 22, 2021, 8:15am UTC](https://forum.uipath.com/t/issue-in-data-table/285241/1 "2021-01-22T08:15:56Z")

</div>

Hello Team,  
Hope you are doing good. I am processing a workflow for salesOrder edit.  
Here i am taking the value of SalesOrder from Queue and Date from config file and the processing further steps.  
At the end i want to put both values to DataTable.  
But i am getting error in Add Data row.  
Please find the attached screenshot. Please let me know for any more information required.  
Build Data Table:

 ![image](https://global.discourse-cdn.com/uipath/original/3X/3/5/35ce6780483e23cb114096c5392060536cafde38.png)  
Below is the screenshot for Add Data row for which i am getting an error.  
 ![image](https://global.discourse-cdn.com/uipath/original/3X/d/4/d4283757b88789ca850b449ba7b3394c0071c055.png)

The intention is to put the entry in data table after every successfull iteration

Thanks & regards,  
Amit Kulkarni

---

<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:** [January 22, 2021, 8:21am UTC](https://forum.uipath.com/t/issue-in-data-table/285241/2 "2021-01-22T08:21:40Z")

</div>

I had some quries,

Why u are looping through an empty datatable out\_DT\_Data since it is empty, it will throw error.

is this workflow is whole under loop?

can u explain please

---

<div class="post-metadata">

**Author:** ![dimibot](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/dimibot/32/176783_2.png) [@dimibot](https://forum.uipath.com/u/dimibot)\
**Post date:** [January 22, 2021, 8:23am UTC](https://forum.uipath.com/t/issue-in-data-table/285241/3 "2021-01-22T08:23:03Z")

</div>

It is not possible to loop through a table and at the same time add a new row

Simply use add data row, without looping 🙂

---

<div class="post-metadata">

**Author:** ![amitkk\_84](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/amitkk_84/32/177094_2.png) [@amitkk\_84](https://forum.uipath.com/u/amitkk_84)\
**Post date:** [January 22, 2021, 8:30am UTC](https://forum.uipath.com/t/issue-in-data-table/285241/4 "2021-01-22T08:30:56Z")

</div>

Oh I thought is to first build and then add.  
Its not under a loop.It will take entries from the queue

---

<div class="post-metadata">

**Author:** ![amitkk\_84](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/amitkk_84/32/177094_2.png) [@amitkk\_84](https://forum.uipath.com/u/amitkk_84)\
**Post date:** [January 22, 2021, 8:31am UTC](https://forum.uipath.com/t/issue-in-data-table/285241/5 "2021-01-22T08:31:17Z")

</div>

Ok Thanks will try it but in add data row i am not able to add arguements as show in the pic.

---

<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:** [January 22, 2021, 8:34am UTC](https://forum.uipath.com/t/issue-in-data-table/285241/6 "2021-01-22T08:34:46Z")

</div>

Hi @amitkk_84 there is ‘.’ at the beginning of each variables in the add datarow, remove that and validation error will be gone.  
 ![image](https://global.discourse-cdn.com/uipath/original/3X/9/4/945306b16a90cd6672c2fd28d0e1e795c773c02b.png)

Regards

Nived N

Happy Automation

---

<div class="post-metadata">

**Author:** ![amitkk\_84](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/amitkk_84/32/177094_2.png) [@amitkk\_84](https://forum.uipath.com/u/amitkk_84)\
**Post date:** [January 22, 2021, 8:56am UTC](https://forum.uipath.com/t/issue-in-data-table/285241/7 "2021-01-22T08:56:59Z")

</div>

I did that but i am getting error as  
Add Data Row: Object reference not set to an instance of an object.

 ![image](https://global.discourse-cdn.com/uipath/original/3X/e/f/efb1fa85dcdf5fbc457cb2dd5b9388d31e1a9898.png)

Also if the first iteration is over and if there are any items in queue it will agaun process the same workflow and in ideally it should create a new entry in add data row.

Can u please help

---

<div class="post-metadata">

**Author:** ![dimibot](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/dimibot/32/176783_2.png) [@dimibot](https://forum.uipath.com/u/dimibot)\
**Post date:** [January 22, 2021, 9:39am UTC](https://forum.uipath.com/t/issue-in-data-table/285241/8 "2021-01-22T09:39:18Z")

</div>

Hi you are getting this error because you have not initialized the datatable.  
You need to put back build datatable activity.

---

<div class="post-metadata">

**Author:** ![amitkk\_84](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/amitkk_84/32/177094_2.png) [@amitkk\_84](https://forum.uipath.com/u/amitkk_84)\
**Post date:** [January 22, 2021, 12:51pm UTC](https://forum.uipath.com/t/issue-in-data-table/285241/9 "2021-01-22T12:51:27Z")

</div>

I put the build data table back and declare local variable and it is working fine but my concern is  
for first time it will load the entry but for the second iteration will it overwrite or automatically write it below the first value.  
Or do i need to add for loop.Currently my workflow is shown below.

 ![image](https://global.discourse-cdn.com/uipath/original/3X/6/2/624b361611d2b8e4d8856f94d22de7ba948f8517.png)

---

<div class="post-metadata">

**Author:** ![dimibot](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/dimibot/32/176783_2.png) [@dimibot](https://forum.uipath.com/u/dimibot)\
**Post date:** [January 22, 2021, 1:26pm UTC](https://forum.uipath.com/t/issue-in-data-table/285241/10 "2021-01-22T13:26:16Z")

</div>

In this case the problem is not the add row activity but the build datatable activity. It will try to re-initialize an existing datatable.

You have two options:

1. move the activity build datatable in a part of a process that runs only once (eg when reading the config file)
2. Keep build datatable activity there but use an if statement to check if datatable is nothing .

---

<div class="post-metadata">

**Author:** ![amitkk\_84](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/amitkk_84/32/177094_2.png) [@amitkk\_84](https://forum.uipath.com/u/amitkk_84)\
**Post date:** [January 22, 2021, 2:02pm UTC](https://forum.uipath.com/t/issue-in-data-table/285241/11 "2021-01-22T14:02:59Z")

</div>

Hello Dimibot,  
So what should be done in this case?

---

<div class="post-metadata">

**Author:** ![dimibot](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/dimibot/32/176783_2.png) [@dimibot](https://forum.uipath.com/u/dimibot)\
**Post date:** [January 22, 2021, 2:31pm UTC](https://forum.uipath.com/t/issue-in-data-table/285241/12 "2021-01-22T14:31:17Z")

</div>

I don’t know all the requirements of your process and where exactly you need to use this datatable so i can not give you an answer to your question on which option to choose ☹

---

<div class="post-metadata">

**Author:** ![anandji05](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/anandji05/32/134212_2.png) [@anandji05](https://forum.uipath.com/u/anandji05)\
**Post date:** [January 22, 2021, 4:07pm UTC](https://forum.uipath.com/t/issue-in-data-table/285241/13 "2021-01-22T16:07:25Z")

</div>

@amitkk_84

Hi,

Take a variable, Variable type DataRow and assign the value Datatable.NewRow.  
For example there is a Add DataRow which has testDataTable.  
Then suppose you want to add first data item in a datatable.

Firstname = row(0).ToString  
FirstRowData = Datatable.NewRow  
FirstRowData(“FirstName”) =Firstname  
(AddDataRow)

Please feel free if any doubt.

Regards  
Anand

---

<div class="post-metadata">

**Author:** ![kantheshm](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/kantheshm/32/198299_2.png) [@kantheshm](https://forum.uipath.com/u/kantheshm)\
**Post date:** [January 22, 2021, 5:26pm UTC](https://forum.uipath.com/t/issue-in-data-table/285241/14 "2021-01-22T17:26:25Z")

</div>

hi @amitkk_84 ,

In add data row activity, in arrayrow property add expression as  
{var1,var2}

When you do that, you can see some “.” operator, remove that. And check whether this workflow is running or not.

don’t use any for each row activity.

---

<div class="post-metadata">

**Author:** ![amitkk\_84](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/amitkk_84/32/177094_2.png) [@amitkk\_84](https://forum.uipath.com/u/amitkk_84)\
**Post date:** [January 25, 2021, 4:57am UTC](https://forum.uipath.com/t/issue-in-data-table/285241/15 "2021-01-25T04:57:15Z")

</div>

Thanks a lot it worked.

---

<div class="post-metadata">

**Author:** ![amitkk\_84](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/amitkk_84/32/177094_2.png) [@amitkk\_84](https://forum.uipath.com/u/amitkk_84)\
**Post date:** [January 25, 2021, 4:58am UTC](https://forum.uipath.com/t/issue-in-data-table/285241/16 "2021-01-25T04:58:02Z")

</div>

Will check that out and let you know

---

<div class="post-metadata">

**Author:** ![amitkk\_84](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/amitkk_84/32/177094_2.png) [@amitkk\_84](https://forum.uipath.com/u/amitkk_84)\
**Post date:** [January 25, 2021, 4:58am UTC](https://forum.uipath.com/t/issue-in-data-table/285241/17 "2021-01-25T04:58:32Z")

</div>

Thanks a lot.Will check

---

<div class="post-metadata">

**Author:** ![amitkk\_84](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/amitkk_84/32/177094_2.png) [@amitkk\_84](https://forum.uipath.com/u/amitkk_84)\
**Post date:** [January 25, 2021, 5:58am UTC](https://forum.uipath.com/t/issue-in-data-table/285241/18 "2021-01-25T05:58:45Z")

</div>

Hello Dimibot,  
As per your suggestion, i have done blow things.  
Declared the build datatable in config which is shown below.

 ![image](https://global.discourse-cdn.com/uipath/original/3X/4/e/4e51524cbc61a8ad59e33ba7f2b4e254224aec7b.png)

Now in the Process, i am using add data row as shown below.

 ![image](https://global.discourse-cdn.com/uipath/original/3X/b/2/b22811dc2aa4382c2553a0e3f3ef2d861e65a2f4.png)

Now i have a query here as since i have created an arguement and add as B\_DT , now how can i use the value in the add datarow where i need to mention the Datatable.

---

<div class="post-metadata">

**Author:** ![kantheshm](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/kantheshm/32/198299_2.png) [@kantheshm](https://forum.uipath.com/u/kantheshm)\
**Post date:** [January 25, 2021, 6:03am UTC](https://forum.uipath.com/t/issue-in-data-table/285241/19 "2021-01-25T06:03:20Z")

</div>

Hi @amitkk_84 ,

Mention over here →   
 ![image](https://global.discourse-cdn.com/uipath/original/3X/2/1/2125d50155ba826b475b5a0753928ecc8711edb1.png)

---

<div class="post-metadata">

**Author:** ![amitkk\_84](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/amitkk_84/32/177094_2.png) [@amitkk\_84](https://forum.uipath.com/u/amitkk_84)\
**Post date:** [January 25, 2021, 6:04am UTC](https://forum.uipath.com/t/issue-in-data-table/285241/20 "2021-01-25T06:04:11Z")

</div>

Yes but that value is not getting displayed if i search for it.  
Am i doing something wrong.

[Next page](https://forum.uipath.com/t/issue-in-data-table/285241.md?page=2)
