cancel
Showing results for 
Search instead for 
Did you mean: 

find specific value from collection 1 to collection 2

LorenzoCapocci1
Level 5


Hi Team, as per example below I need to check if items from collection1 are within collection2 but in collection2 we may find more than 10 results...
At the moment I have set to collection to check for duplicate values, but if the below happens, I need to make sure that I don't get the error (now row exist in collection), so it can check and see if any of the items from collection1 are within collection 2, and move thematching item into a new collection

can you help to find an example to follow?
note from collection 1 there will be no empty row to fill up
thank you


Collection1 Collection2
Form1 Form2
GI13289312 GI13289305
GI13289313 GI13289306
GI13289307
GI13289308
GI13289309
GI13289310
GI13289311
GI13289312
GI13289313
5 REPLIES 5

VedSengupta
Level 6

Hello Lorenzo,
Why not use a filter collection action followed by a decision stage to check existence of item in Col1 in Col2?

For Example, Let us take your collections above and then the below Steps :

Step 1 : Loop Through collection 1.
Step 2 : Filter item of Col1 in Col2 and store in a temporary Collection  -->  [col2.field]='[col1.field]' { Stored in Temporary Collection. Let us call it Temp}
Step 3: Check number of rows of Temp.
              if Temp>0
                    element of Col1 exists in Col2
              else
                     element of Col1 does not exist in Col2
Step 4 : Clear Collection Temp for next iteration.
Step 5: Increment counter in Col1 Loop and start Step 1 unless collection end is reached.


Best Regards,
Ved Sengupta
RPA Developer
Deloitte India (Offices of the US)
Bangalore

------------------------------ Best Regards, Ved Sengupta RPA Developer Deloitte India (Offices of the US) Bangalore | INDIA *If you find this post helpful mark it as best answer* ------------------------------

LorenzoCapocci1
Level 5
Hello @Ved Sengupta, thank you for helping on this, but I would like to ask if it is possible to have an example of this, as I am still new on RPA, and this would help me a lot, if you could do that.. especially with the code you have provided... Thank you very much​

LorenzoCapoccia
Level 4
Hi @Ved Sengupta, got it to work. thank you

36704.png

VedSengupta
Level 6
Hello Lorenzo,
I have got an query.

In Loop Collection2 
Immediately after starting the nested Loop you are checking a decision stage followed by some action.
What value in decision stage are you exactly checking? And From which action are you getting that Value?
36705.png
Best Regards,
Ved Sengupta
RPA Developer
Deloitte India (Offices of the US)
Bangalore
------------------------------ Best Regards, Ved Sengupta RPA Developer Deloitte India (Offices of the US) Bangalore | INDIA *If you find this post helpful mark it as best answer* ------------------------------

LorenzoCapocci1
Level 5
Hello @Ved Sengupta​Thank you for your support, and, I need to apologize for the delay in  answering...   so this take reference from value read in order to check if value exist in the collection 2 Image Data! so i can go ahead and make a compare action36706.png36707.png