# Error while passing variable

**URL:** <https://forum.uipath.com/t/error-while-passing-variable/166980>\
**Category:** Help\
**Tags:** reframework, error, system, activities\
**Created:** [November 11, 2019, 3:15pm UTC](https://forum.uipath.com/t/error-while-passing-variable/166980 "2019-11-11T15:15:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Veselin\_Ganchev](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/veselin_ganchev/32/63217_2.png) [@Veselin\_Ganchev](https://forum.uipath.com/u/Veselin_Ganchev)\
**Post date:** [November 11, 2019, 3:15pm UTC](https://forum.uipath.com/t/error-while-passing-variable/166980/1 "2019-11-11T15:15:45Z")

</div>

Hello,  
I get error message: Add Data Row: Object reference not set to an instance of an object.  
When trying to pass argument from Process statement to Process Transaction.

 ![1](https://global.discourse-cdn.com/uipath/original/3X/0/7/072d81f954b81c699098bc0624ecba5b2bf6cfb4.png)

* * *

 ![2](https://global.discourse-cdn.com/uipath/original/3X/a/5/a5b2b16d2d87e2d9e46c57e5f248b2e325db32c6.png)

 ![3](https://global.discourse-cdn.com/uipath/original/3X/c/7/c7d769c985915be8f9564c2bca6825619b704598.png)

On the exit statement from Process Transaction I’m using add row activity.  
I’m using there Result, but for some reason he is saying that is not set to an instance of an object…

Thanks in advance

---

<div class="post-metadata">

**Author:** ![Raghavendraprasad](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/raghavendraprasad/32/66936_2.png) [@Raghavendraprasad](https://forum.uipath.com/u/Raghavendraprasad)\
**Post date:** [November 11, 2019, 3:19pm UTC](https://forum.uipath.com/t/error-while-passing-variable/166980/2 "2019-11-11T15:19:30Z")

</div>

Well try changing the Direction of passing the variable to ‘out’ I can see that it is ‘in’.

---

<div class="post-metadata">

**Author:** ![Veselin\_Ganchev](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/veselin_ganchev/32/63217_2.png) [@Veselin\_Ganchev](https://forum.uipath.com/u/Veselin_Ganchev)\
**Post date:** [November 11, 2019, 3:24pm UTC](https://forum.uipath.com/t/error-while-passing-variable/166980/3 "2019-11-11T15:24:28Z")

</div>

@Raghavendraprasad  
Where I must change it?  
Process.xaml arguments or when I invoke process.xaml or both of them must be out?  
Not sure how to do it.

---

<div class="post-metadata">

**Author:** ![Raghavendraprasad](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/raghavendraprasad/32/66936_2.png) [@Raghavendraprasad](https://forum.uipath.com/u/Raghavendraprasad)\
**Post date:** [November 11, 2019, 3:30pm UTC](https://forum.uipath.com/t/error-while-passing-variable/166980/4 "2019-11-11T15:30:38Z")

</div>

So here is the approach.  
The arguments list that you see on the left is the ‘invoked workflow’s’ arguments.

Out-result should come ‘out’ from the child process into the ‘Main’ process so in the import or edit arguments section you have to change the direction to ‘out’ so that value is passed.

if variables are not initialized then that might also cause this error so check all xamls carefully. 🙂

---

<div class="post-metadata">

**Author:** ![Palaniyappan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/palaniyappan/32/524095_2.png) [@Palaniyappan](https://forum.uipath.com/u/Palaniyappan)\
**Post date:** [November 11, 2019, 3:51pm UTC](https://forum.uipath.com/t/error-while-passing-variable/166980/5 "2019-11-11T15:51:05Z")

</div>

Fine  
change the direction here in the PROCESS XAML invoking INVOKE WORKFLOW FILE activity from IN to **OUT**  
 ![image](https://global.discourse-cdn.com/uipath/original/3X/c/6/c6a15d6a1ce77b3cdc7e0add5f55bc11e9427612.png)

because the arguments been passed with value in PROCESS xaml if have to be used in outer xaml, it must be set with OUT direction so that the value of argument out\_Result will be set to global variable Result  
then we can use variable Result in the ADD DATA ROW activity in MAIN xaml inside the Process Transaction sequence

hope this would help you  
Cheers @Veselin_Ganchev

---

<div class="post-metadata">

**Author:** ![Veselin\_Ganchev](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/veselin_ganchev/32/63217_2.png) [@Veselin\_Ganchev](https://forum.uipath.com/u/Veselin_Ganchev)\
**Post date:** [November 11, 2019, 7:49pm UTC](https://forum.uipath.com/t/error-while-passing-variable/166980/6 "2019-11-11T19:49:09Z")

</div>

@Palaniyappan and @Raghavendraprasad  
give correct answer.

---

<div class="post-metadata">

**Author:** ![Palaniyappan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/palaniyappan/32/524095_2.png) [@Palaniyappan](https://forum.uipath.com/u/Palaniyappan)\
**Post date:** [November 11, 2019, 7:53pm UTC](https://forum.uipath.com/t/error-while-passing-variable/166980/7 "2019-11-11T19:53:49Z")

</div>

Cheers @Veselin_Ganchev

---

<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:** [November 14, 2019, 7:53pm UTC](https://forum.uipath.com/t/error-while-passing-variable/166980/8 "2019-11-14T19:53:52Z")

</div>

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