cancel
Showing results for 
Search instead for 
Did you mean: 

Compare the collection column data with itself

AndyJacob
Level 2

Hi All,

I have a collection with column Fruits and kid's names with 3 rows where the data into this column is random through other validations.

The task is to check if the data that is there in the column has all the same fruit names or different.

If there are same fruit names in fruit column then I have to send a mail saying all the kids have same fruit.

If there fruit column has at least 2 same fruit names I have to send the mail saying these 2 particular kids have same fruit. And send another mail saying the third kid has different one.(2 mails)

Like wise.. comes to 3 mails if all are different fruits

How do I compare or Filter and get the data so that I know which kid have which.



------------------------------
Andy Jacob
------------------------------

5 REPLIES 5

Hello Andy,
In this scenario, you can go through the main list and perform the appropriate validations using it as a base.
In the process, create an action and select the option "Utility – Collection Manipulation" and select "Filter Collection"
23579.png
In Entries select the Collection you want to filter. Create an expression that must be placed between Strings " " as a reference to what will be filtered and from which column.
 
Example: "[exemple] like '%temp%' " 
 
The output will be a Collection where the filtered data will be stored. For quantity validations, you can use "count rows" for this validation;
 
 
Auxiliary references:
 

23580.png

Digitalexchange - Example Process - Collection Manipulation - Download



------------------------------
Leonardo Soares
RPA Developer 
América/Brazil
------------------------------

Leonardo Soares RPA Developer América/Brazil

Hello Andy, you can achieve what you want in various ways, but I'll provide what I believe is the shortest. After all, there's no need to reinvent the wheel, right?

What you need is use Distinct function that you can obtain through this asset in Dx (It is on my box of preferred VBO's) millicon---collection-utility 

With the "Distinct" action, you can obtain only the unique values of a column. Assuming that there will always be 3 rows, using the "Distinct" action will cover all scenarios that you mentioned.

If the main collection has 3 different fruits, the output value of the "Distinct" action will be 3 rows.

If the main collection has 3 identical fruits, the output value of the "Distinct" action will be 1 row.

If the main collection has 2 watermelons and a pineapple, the output value of "Distinct" will be 2. In this scenario, you can loop through the distinct collection and use the value to filter in the main collection with "Utility - Collection Manipulation: Filter" to determine which kids have 2 fruits and which have 1.

Regards!



------------------------------
If this was helpful, please mark it as the best answer 🙂
Daniel Sanhueza
RPA Professional Developer
Deloitte
America/Santiago
------------------------------
Daniel Sanhueza
RPA Professional Developer
Deloitte

Thanks Daniel. It worked.



------------------------------
Andy Jacob
------------------------------

Thank you Leonardo.



------------------------------
Andy Jacob
------------------------------

Hi Andy. Do you mind marking Daniel's answer as correct, so he can get the proper credit for it? Thank you!



------------------------------
Yinka Daramola
------------------------------