# Assign Activity Error Cannot Perform "=" operation Error

**URL:** <https://forum.uipath.com/t/assign-activity-error-cannot-perform-operation-error/475934>\
**Category:** Robot\
**Tags:** question, robot, system, activities\
**Created:** [September 26, 2022, 10:01am UTC](https://forum.uipath.com/t/assign-activity-error-cannot-perform-operation-error/475934 "2022-09-26T10:01:45Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ishan\_Shelke](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ishan_shelke/32/272399_2.png) [@Ishan\_Shelke](https://forum.uipath.com/u/Ishan_Shelke)\
**Post date:** [September 26, 2022, 10:01am UTC](https://forum.uipath.com/t/assign-activity-error-cannot-perform-operation-error/475934/1 "2022-09-26T10:01:46Z")

</div>

Hi, @jack.chan

I have datarow variable called drCommon and I am assigning it a value froom the Datable Output\_DB as

 ![image](https://global.discourse-cdn.com/uipath/original/4X/f/8/2/f8295c94ea2404e584f6a38c5c49b1037d0f7f10.png)  
(cmnString is a variable of String Type which holds the value 25)

While doing this I am getting an Error as :

 ![image](https://global.discourse-cdn.com/uipath/original/4X/7/9/7/797cf3fef6d13a3ebe7f67037840249e1029ec59.png)

Can anyone suggest me something on this ?

---

<div class="post-metadata">

**Author:** ![johnfelix](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/johnfelix/32/333254_2.png) [@johnfelix](https://forum.uipath.com/u/johnfelix)\
**Post date:** [September 26, 2022, 10:33am UTC](https://forum.uipath.com/t/assign-activity-error-cannot-perform-operation-error/475934/2 "2022-09-26T10:33:29Z")

</div>

Hi @Ishan_Shelke

The error message you should get is below, because datatable.select() always returns array of data row. which you cannot assign to a data row variable.

![image](https://global.discourse-cdn.com/uipath/original/4X/b/c/7/bc7b4337d5fb9951fda0f4eb4441882f132a5d15.png)

But you got different error message. could you please check the variable data type of drCommon and Ouput\_DB

![image](https://global.discourse-cdn.com/uipath/original/4X/a/4/7/a47e0ed3a4361b845e65fd5d7f98da3a469ece8e.png)

You should use row index position to assign

Output\_DB.Select(cmnString).ElementAt( **rowIndx** )

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

> (cmnString is a variable of String Type which holds the value 25)

Your select query format is wrong, it should have column name in the query, operator and the filter value.

Please refer to this post for filtering data table

[Four Ways to Filter Data Tables in UiPath Studio | UiPath](https://www.uipath.com/community/rpa-community-blog/four-ways-to-filter-data-table-in-uipath-studio)

Thanks  
John

---

<div class="post-metadata">

**Author:** ![megharajky](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/megharajky/32/345216_2.png) [@megharajky](https://forum.uipath.com/u/megharajky)\
**Post date:** [September 26, 2022, 10:35am UTC](https://forum.uipath.com/t/assign-activity-error-cannot-perform-operation-error/475934/3 "2022-09-26T10:35:11Z")

</div>

(post deleted by author)

---

<div class="post-metadata">

**Author:** ![Sanjit\_Pal](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sanjit_pal/32/193785_2.png) [@Sanjit\_Pal](https://forum.uipath.com/u/Sanjit_Pal)\
**Post date:** [September 26, 2022, 10:35am UTC](https://forum.uipath.com/t/assign-activity-error-cannot-perform-operation-error/475934/4 "2022-09-26T10:35:14Z")

</div>

Hello @Ishan_Shelke ,

You are trying to assign collection of rows to a row type variable, which is not possible. Use the method suggested by @johnfelix

Thanks,  
Sanjit

---

<div class="post-metadata">

**Author:** ![Ishan\_Shelke](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ishan_shelke/32/272399_2.png) [@Ishan\_Shelke](https://forum.uipath.com/u/Ishan_Shelke)\
**Post date:** [September 26, 2022, 10:38am UTC](https://forum.uipath.com/t/assign-activity-error-cannot-perform-operation-error/475934/5 "2022-09-26T10:38:49Z")

</div>

Here as far as I can see the variable type is Array of Datarow which should eventually work

 ![image](https://global.discourse-cdn.com/uipath/original/4X/d/c/4/dc4a465780ed58ab447ab46f2773173fe46c38c0.png)

Output\_DB is a datatable type of variable

Past 1 month, this was working fine this error popped up today

Okay, as per your suggesstion I modified the following cmnString variable to but it’s still not working

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

---

<div class="post-metadata">

**Author:** ![johnfelix](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/johnfelix/32/333254_2.png) [@johnfelix](https://forum.uipath.com/u/johnfelix)\
**Post date:** [September 26, 2022, 10:48am UTC](https://forum.uipath.com/t/assign-activity-error-cannot-perform-operation-error/475934/6 "2022-09-26T10:48:38Z")

</div>

Your error message, code and the screenshot does not sync logically.  
So not sure why this error message appearing now.

Have you recently updated any package versions? if so, then please downgrade packages to older version and try again.

---

<div class="post-metadata">

**Author:** ![johnfelix](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/johnfelix/32/333254_2.png) [@johnfelix](https://forum.uipath.com/u/johnfelix)\
**Post date:** [September 26, 2022, 10:55am UTC](https://forum.uipath.com/t/assign-activity-error-cannot-perform-operation-error/475934/7 "2022-09-26T10:55:16Z")

</div>

Hi @Ishan_Shelke

You code should look like below

Output\_DB.Select(“[Dealer Code] ='”+row(0).ToString.Trim+“'”)

 ![image](https://global.discourse-cdn.com/uipath/original/4X/7/9/1/791b104250cb356a8522084921868be906720179.png)

Please check **row(0).ToString.Trim** has value in it.

---

<div class="post-metadata">

**Author:** ![Ishan\_Shelke](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ishan_shelke/32/272399_2.png) [@Ishan\_Shelke](https://forum.uipath.com/u/Ishan_Shelke)\
**Post date:** [September 26, 2022, 11:03am UTC](https://forum.uipath.com/t/assign-activity-error-cannot-perform-operation-error/475934/8 "2022-09-26T11:03:58Z")

</div>

Ok I’ll try to Explain More Clearly

I have a excel file named A which has columns named Dealer Code, Dealer Name, and City and I am reading it with a read range and storing into a datable called Output\_DB

I have another Excel file named B which also contains the Column Dealer Code, Dealer Name and City.

What I am trying to do is, If the dealer Code in sheet B is also present in the sheet A then I am picking the Whole Row of Sheet A and storing it into a Datable

To pick the Dealer Code of Sheet B I am using the Following Code Snippet.

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

and to search for the Rows in the Sheet A I am trying to use the following code snippet

![image](https://global.discourse-cdn.com/uipath/original/4X/a/9/b/a9b7bbb618a9ce6ad46d394b23ab0e59a6915959.png)

Doing so I am getting the above following Error mentioned in my First post

---

<div class="post-metadata">

**Author:** ![jack.chan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/jack.chan/32/176616_2.png) [@jack.chan](https://forum.uipath.com/u/jack.chan)\
**Post date:** [September 27, 2022, 3:57am UTC](https://forum.uipath.com/t/assign-activity-error-cannot-perform-operation-error/475934/9 "2022-09-27T03:57:10Z")

</div>

@Ishan_Shelke  
`change Output_DB.Select(cmnString)`

to  
`Output_DB.Select(cmnString)(0)`

 ![image](https://global.discourse-cdn.com/uipath/original/4X/1/c/c/1ccc4a9f6994e47b862b76aa72f3d191053b0257.png)

because Select function returns array of datarows whereas drCommon is a single datarow variable

---

<div class="post-metadata">

**Author:** ![johnfelix](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/johnfelix/32/333254_2.png) [@johnfelix](https://forum.uipath.com/u/johnfelix)\
**Post date:** [September 27, 2022, 6:40am UTC](https://forum.uipath.com/t/assign-activity-error-cannot-perform-operation-error/475934/10 "2022-09-27T06:40:26Z")

</div>

Hi @Ishan_Shelke

I am unable to figure out the issue.

Our previously discussed solutions should work but, in your case, it’s not working

Excel A / Sheet A - Output\_DB

 ![image](https://global.discourse-cdn.com/uipath/original/4X/7/d/a/7daa12d26b3b3f1c92404206b9b3c8fdb14f8902.png)

Excel B / Sheet B - dt\_Sheet\_B

 ![image](https://global.discourse-cdn.com/uipath/original/4X/5/6/8/5685ad7131cb6d1c1841069ef62b5da56f3a4e00.png)

So here is the different approach to get same results

**Approach 1 - Using Merge data table**

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

![image](https://global.discourse-cdn.com/uipath/original/4X/4/4/b/44b336e5a3bec8e8c6dd0264c2632971df417e26.png)

[Excel\_Data\_Filter\_Approach\_1.xaml](https://forum.uipath.com/uploads/short-url/pyk54UWKFo3nBFLI1Pi4l0W2m1C.xaml) (18.8 KB)

**Approach 2 - Using Filter data table**

![image](https://global.discourse-cdn.com/uipath/original/4X/d/9/4/d9444c5661a6f88327657f38afc7353872e2693e.png)

**out\_dt\_Output**

![image](https://global.discourse-cdn.com/uipath/original/4X/0/0/9/0090a5eb017d9e6c6e0e48b601b490c2660b5f60.png)

[Excel\_Data\_Filter\_Approach\_2.xaml](https://forum.uipath.com/uploads/short-url/9AXkk2ky4hyNhdcUGgY2OTDRbqa.xaml) (18.8 KB)

Points to note:

1. Used clone method to copy the header from **Output\_DB** to **dt\_Temp**
2. Used **dt\_Temp** to store filtered rows from **Output\_DB**
3. These two approaches have output in **data table** data type instead of **data row / array of data row** data type
4. **Output Data Table** activity is used for debugging purpose and not applicable to your requirement

Please let us know if you are still facing the error.

Thanks  
John

---

<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:** [September 30, 2022, 6:40am UTC](https://forum.uipath.com/t/assign-activity-error-cannot-perform-operation-error/475934/11 "2022-09-30T06:40:51Z")

</div>

Closed on September 30, 2022, 6:40am UTC

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