# System.reflection.targetinvocationexception during assign activity

**URL:** <https://forum.uipath.com/t/system-reflection-targetinvocationexception-during-assign-activity/187667>\
**Category:** Help\
**Tags:** datatable, error, system, activities\
**Created:** [January 23, 2020, 11:05am UTC](https://forum.uipath.com/t/system-reflection-targetinvocationexception-during-assign-activity/187667 "2020-01-23T11:05:08Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anamika15](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/anamika15/32/92700_2.png) [@Anamika15](https://forum.uipath.com/u/Anamika15)\
**Post date:** [January 23, 2020, 11:05am UTC](https://forum.uipath.com/t/system-reflection-targetinvocationexception-during-assign-activity/187667/1 "2020-01-23T11:05:08Z")

</div>

Hi All  
while performing assign activity, i m getting below error:

 ![image](https://global.discourse-cdn.com/uipath/original/3X/5/4/54f8e4990a1784b24d4abab7154b9a498d37b0b5.png)  
There is no validation error in code. Please help to resolve the issue.

Thanks!!!

---

<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:** [January 23, 2020, 11:07am UTC](https://forum.uipath.com/t/system-reflection-targetinvocationexception-during-assign-activity/187667/2 "2020-01-23T11:07:02Z")

</div>

HI  
is this assign activity been used within any LOOP  
can i have a view on full structure of workflow if possible with a screenshot  
Cheers @Anamika15

---

<div class="post-metadata">

**Author:** ![Anamika15](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/anamika15/32/92700_2.png) [@Anamika15](https://forum.uipath.com/u/Anamika15)\
**Post date:** [January 23, 2020, 5:47pm UTC](https://forum.uipath.com/t/system-reflection-targetinvocationexception-during-assign-activity/187667/3 "2020-01-23T17:47:49Z")

</div>

Hi @Palaniyappan  
[Company Info.xaml](https://forum.uipath.com/uploads/short-url/i9F8S9J8xXP1gJFRqalYDpC1P0R.xaml) (22.3 KB)  
Attached is the .xaml file for your reference. Please check and let me know the issue.  
Its working fine for 2-3 row items and then it is throwing the exception.

---

<div class="post-metadata">

**Author:** ![bcorrea](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/bcorrea/32/103778_2.png) [@bcorrea](https://forum.uipath.com/u/bcorrea)\
**Post date:** [January 23, 2020, 6:36pm UTC](https://forum.uipath.com/t/system-reflection-targetinvocationexception-during-assign-activity/187667/4 "2020-01-23T18:36:32Z")

</div>

If this works for a couple of rows and then breaks, will have to be cause of the value you are trying to assign to the column will eventually be wrong, you need to put a break point in that assign and look at that value when it errors out.

---

<div class="post-metadata">

**Author:** ![Anamika15](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/anamika15/32/92700_2.png) [@Anamika15](https://forum.uipath.com/u/Anamika15)\
**Post date:** [January 24, 2020, 5:51am UTC](https://forum.uipath.com/t/system-reflection-targetinvocationexception-during-assign-activity/187667/5 "2020-01-24T05:51:57Z")

</div>

When I am printing the output in a message box, its giving the correct result. But during the Assign Address activity only its giving error. Assign Phone is also working fine.

---

<div class="post-metadata">

**Author:** ![Pradeep\_Shiv](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/pradeep_shiv/32/496519_2.png) [@Pradeep\_Shiv](https://forum.uipath.com/u/Pradeep_Shiv)\
**Post date:** [January 24, 2020, 6:06am UTC](https://forum.uipath.com/t/system-reflection-targetinvocationexception-during-assign-activity/187667/6 "2020-01-24T06:06:53Z")

</div>

can we see the updated worklow?

---

<div class="post-metadata">

**Author:** ![Pradeep\_Shiv](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/pradeep_shiv/32/496519_2.png) [@Pradeep\_Shiv](https://forum.uipath.com/u/Pradeep_Shiv)\
**Post date:** [January 24, 2020, 6:09am UTC](https://forum.uipath.com/t/system-reflection-targetinvocationexception-during-assign-activity/187667/7 "2020-01-24T06:09:58Z")

</div>

row.item(“Address”) so here **Address** is your column name right??  
you can directly mention do it like this **row(“Address”) = Company\_Address**

---

<div class="post-metadata">

**Author:** ![Anamika15](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/anamika15/32/92700_2.png) [@Anamika15](https://forum.uipath.com/u/Anamika15)\
**Post date:** [January 24, 2020, 8:18am UTC](https://forum.uipath.com/t/system-reflection-targetinvocationexception-during-assign-activity/187667/8 "2020-01-24T08:18:59Z")

</div>

Tried… but not working.

---

<div class="post-metadata">

**Author:** ![supermanPunch](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/supermanpunch/32/133652_2.png) [@supermanPunch](https://forum.uipath.com/u/supermanPunch)\
**Post date:** [January 27, 2020, 4:54am UTC](https://forum.uipath.com/t/system-reflection-targetinvocationexception-during-assign-activity/187667/9 "2020-01-27T04:54:03Z")

</div>

@Anamika15 Check the Workflow by Inserting Wait For Ready Property as Complete in all UI Automation Activites used

---

<div class="post-metadata">

**Author:** ![Anamika15](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/anamika15/32/92700_2.png) [@Anamika15](https://forum.uipath.com/u/Anamika15)\
**Post date:** [January 27, 2020, 5:38am UTC](https://forum.uipath.com/t/system-reflection-targetinvocationexception-during-assign-activity/187667/10 "2020-01-27T05:38:51Z")

</div>

Finally I used try and catch and its working ok now. Its skipping the assign whenever the exception occurs and continues with rest of the workflow.

---

<div class="post-metadata">

**Author:** ![supermanPunch](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/supermanpunch/32/133652_2.png) [@supermanPunch](https://forum.uipath.com/u/supermanPunch)\
**Post date:** [January 27, 2020, 5:39am UTC](https://forum.uipath.com/t/system-reflection-targetinvocationexception-during-assign-activity/187667/11 "2020-01-27T05:39:58Z")

</div>

@Anamika15 The Exceptions Shouldn’t be occurring right? 😅

---

<div class="post-metadata">

**Author:** ![Anamika15](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/anamika15/32/92700_2.png) [@Anamika15](https://forum.uipath.com/u/Anamika15)\
**Post date:** [January 30, 2020, 10:34am UTC](https://forum.uipath.com/t/system-reflection-targetinvocationexception-during-assign-activity/187667/12 "2020-01-30T10:34:37Z")

</div>

tried this as well… still exception is coming.

---

<div class="post-metadata">

**Author:** ![Anamika15](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/anamika15/32/92700_2.png) [@Anamika15](https://forum.uipath.com/u/Anamika15)\
**Post date:** [February 6, 2020, 7:20am UTC](https://forum.uipath.com/t/system-reflection-targetinvocationexception-during-assign-activity/187667/13 "2020-02-06T07:20:42Z")

</div>

Hi all,

I changed the selectors for Address and it took some time to get most stable selectors but finally I am not getting this exception anymore.

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![suriyasivaselva](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@suriyasivaselva](https://forum.uipath.com/u/suriyasivaselva)\
**Post date:** [February 19, 2020, 7:51am UTC](https://forum.uipath.com/t/system-reflection-targetinvocationexception-during-assign-activity/187667/14 "2020-02-19T07:51:12Z")

</div>

I had same issues but got resolved by doing Variable.ToString

---

<div class="post-metadata">

**Author:** ![Dhouha\_Cherif](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/dhouha_cherif/32/180486_2.png) [@Dhouha\_Cherif](https://forum.uipath.com/u/Dhouha_Cherif)\
**Post date:** [July 2, 2021, 1:34pm UTC](https://forum.uipath.com/t/system-reflection-targetinvocationexception-during-assign-activity/187667/15 "2021-07-02T13:34:05Z")

</div>

i did not get it .  
How did you changed tht selector  
This is my code and in blue i circled where the exception appear

 ![image](https://global.discourse-cdn.com/uipath/original/3X/8/5/85ce66454d590b33f124f8ff7c70a653c7432be8.png)  
Can you please tell me what i have to change?
