finding duplicate record in pagelist based on 1st Property and concatenate 2nd property for duplicate records

Hello

I have a pagelist A.pxResults(3) as shown below

A.pxResults(1) has .property1(value 101), .property2(ABC)
A.pxResults(2) has .property1(value 201), .property2(MMM)
A.pxResults(3) has .property1(value 101), .property2(XYZ)

On click of a button I need to find the duplicates in the pagelist based on property1 but need to concatenate property2 values separated by semicolon of the duplicate records. My output should be

B.pxResults(1) should have property1(101), property2(ABC;XYZ)
B.pxResults(2) should have property1(201), property2(MMM)

How can i achieve this?

@John Joseph

2 approaches I can think of. you can refer attached file.

Temp Notes.txt (1.33 KB)

@AvikMitra

Thanks Much. 1st approach will cater my needs. As i am pretty new to this type of coding, can you pls do this in pega rule and send me the screen shot. Thanks for you help.

@John Joseph

I would rather suggest that give it a try first. you can learn things when you do hands on.

in case you are not being able to implement, refer to the attached doc.

Copy data implementation.docx (298 KB)

@AvikMitra

Thanks Avik. It worked.