Display contact numbers from different groups

adi

New Member
Hi i have three collections

collection1

S.no Phone number
1 12345
2 678910
3 111213
4 141516

collection2

S.no Phone number
1 12345
2 678910
3 141516

collection3

S.no Phone number
1 12345
2 111213
3 141516

i want to display the output in this way


Sno Phone number collection1 collection2 collection3

1 12345 Yes Yes Yes
2 678910 yes Yes No
3 111213 Yes No Yes
4 141516 Yes Yes Yes


how can we achieve this using blueprism ?
 

VJR

Well-Known Member
Hi adi,

There could be more than one logic to do this same thing.
I have attached the files for the overall diagram and the logic of the flow is written below.
If you prefer to do it on your own then you can just go through the logic part in the write-up below.

1.jpg: This contains the complete process diagram.
I've tried to manage the diagram in a single screenshot hence looks clumsy :).

2.jpg: Create an empty OutputCollection with the desired columns of SrNo and Phone Number.

3.jpg: Append Collections 1, 2 and 3 to this new OutputCollection.
In the Output parameter give the name as OutputCollection for all 3 of the Action stages.

4.jpg: After appending all 3 collections it would look like this (based on the data you have posted for each of the 3 Input collections).

5.jpg: Design another collection this time with 3 additional columns as shown. This collection is the one that will contain your Final output

6.jpg: Use a Loop stage to loop through the items in the combined OutputCollection.
In the running loop, check if the value from the OutputCollection is present in the FinalCollection.
The Output parameter for this stage is 'Found' data item.
Here we are trying to remove duplicates as well as update 'Yes' and 'No' in one single loop.
If Found is True then it means the Phone Number is already present so no need to add again. Point it to the Loop End to get the next item.
If Not found then add a new row to the Final Collection using the 'Add Row' action of Collection VBO. Only after adding a new row we will be able to add data to it.

7.jpg: Add a Multi Calc stage which will perform multiple operations at once.
-Add phone number from Output Collection to FinalCollection
-A counter variable is maintained to insert into the Sr.No column of FinalCollection.
Initial value of counter variable is 1
-Increment the SrNoCounter variable so that next time it inserts the next SrNo in the Final Collection

8.jpg: There are 3 action stages to check if the PhoneNumber from the OutputCollection (that we are looping) is present in which of the 3 InputCollections (coll1, coll2, coll3). The output parameter of these 3 Action stages are 3 flags - FoundinColl1, FoundinColl2 and FoundinColl3

9.jpg: If the FoundColl flag variable is True then write 'Yes' to the respective column of the FinalCollection.
If False then write 'No'.
You need to do this thrice, one for each InputCollection.

10.jpg: Once all three collections are compared then the flow is pointed to Loop End so that the next item from the OutputCollection is picked up.
Once the loop is over it shows the final result as this.

You might need to check if it handles scenarios like Empty collection, etc.
Run with various inputs and let me know if there is any problem.
 

Attachments

  • 1. Process Diagram.JPG
    1. Process Diagram.JPG
    82.7 KB · Views: 56
  • 2. Output Collection.JPG
    2. Output Collection.JPG
    21 KB · Views: 56
  • 3. Append Collections to Output collection.JPG
    3. Append Collections to Output collection.JPG
    33.5 KB · Views: 46
  • 4. Output collection after appending.JPG
    4. Output collection after appending.JPG
    29.6 KB · Views: 45
  • 5. Final Collection.JPG
    5. Final Collection.JPG
    24.8 KB · Views: 43
  • 6. Contains Phone in FinalCollection.JPG
    6. Contains Phone in FinalCollection.JPG
    40.4 KB · Views: 40
  • 7. Multi Calc stage.JPG
    7. Multi Calc stage.JPG
    28.6 KB · Views: 38
  • 8. Contains Phone number in Coll1.JPG
    8. Contains Phone number in Coll1.JPG
    38 KB · Views: 34
  • 9. Write Yes in collections.JPG
    9. Write Yes in collections.JPG
    27.1 KB · Views: 34
  • 10. FinalCollection.JPG
    10. FinalCollection.JPG
    41 KB · Views: 35

adi

New Member
Hi VJR

Thanks for your help. it works fine. i got the result as expected.




Hi adi,

There could be more than one logic to do this same thing.
I have attached the files for the overall diagram and the logic of the flow is written below.
If you prefer to do it on your own then you can just go through the logic part in the write-up below.

1.jpg: This contains the complete process diagram.
I've tried to manage the diagram in a single screenshot hence looks clumsy :).

2.jpg: Create an empty OutputCollection with the desired columns of SrNo and Phone Number.

3.jpg: Append Collections 1, 2 and 3 to this new OutputCollection.
In the Output parameter give the name as OutputCollection for all 3 of the Action stages.

4.jpg: After appending all 3 collections it would look like this (based on the data you have posted for each of the 3 Input collections).

5.jpg: Design another collection this time with 3 additional columns as shown. This collection is the one that will contain your Final output

6.jpg: Use a Loop stage to loop through the items in the combined OutputCollection.
In the running loop, check if the value from the OutputCollection is present in the FinalCollection.
The Output parameter for this stage is 'Found' data item.
Here we are trying to remove duplicates as well as update 'Yes' and 'No' in one single loop.
If Found is True then it means the Phone Number is already present so no need to add again. Point it to the Loop End to get the next item.
If Not found then add a new row to the Final Collection using the 'Add Row' action of Collection VBO. Only after adding a new row we will be able to add data to it.

7.jpg: Add a Multi Calc stage which will perform multiple operations at once.
-Add phone number from Output Collection to FinalCollection
-A counter variable is maintained to insert into the Sr.No column of FinalCollection.
Initial value of counter variable is 1
-Increment the SrNoCounter variable so that next time it inserts the next SrNo in the Final Collection

8.jpg: There are 3 action stages to check if the PhoneNumber from the OutputCollection (that we are looping) is present in which of the 3 InputCollections (coll1, coll2, coll3). The output parameter of these 3 Action stages are 3 flags - FoundinColl1, FoundinColl2 and FoundinColl3

9.jpg: If the FoundColl flag variable is True then write 'Yes' to the respective column of the FinalCollection.
If False then write 'No'.
You need to do this thrice, one for each InputCollection.

10.jpg: Once all three collections are compared then the flow is pointed to Loop End so that the next item from the OutputCollection is picked up.
Once the loop is over it shows the final result as this.

You might need to check if it handles scenarios like Empty collection, etc.
Run with various inputs and let me know if there is any problem.
 
Top