27-02-24 06:39 PM
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
------------------------------
27-02-24 08:35 PM
Digitalexchange - Example Process - Collection Manipulation - Download
------------------------------
Leonardo Soares
RPA Developer
América/Brazil
------------------------------
27-02-24 08:56 PM
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!
28-02-24 08:15 PM
Thanks Daniel. It worked.
28-02-24 08:16 PM
Thank you Leonardo.
12-03-24 07:18 PM
Hi Andy. Do you mind marking Daniel's answer as correct, so he can get the proper credit for it? Thank you!