Question

CSV format string from a Pagelist property values

Hi All,

I have a requirement to capture list of values of a property which is pagelist and show it in string in a comma separated format in a hierarchy of embedded page lists.

For Ex: I have a property PropertyN in PageListC in the hierarchy pyWorkPage.Page.PageListA().PageListB().PageListC()

PropertyN has values as follows --> pyWorkPage.Page.PageListA(1).PageListB(1).PageListC(1) - P1

pyWorkPage.Page.PageListA(1).PageListB(1).PageListC(2) - P2

pyWorkPage.Page.PageListA(1).PageListB(1).PageListC(3) -P3

and

pyWorkPage.Page.PageListA(1).PageListB(2).PageListC(1) - P1

pyWorkPage.Page.PageListA(1).PageListB(2).PageListC(2) - P4

pyWorkPage.Page.PageListA(1).PageListB(2).PageListC(3) - P5

I have to show a string property PropertyNConcetanted at PageListB level which shows as follows- pyWorkPage.Page.PageListA(1).PageListB(1).PropertyNConcetanted --> P1,P2,P3

Also, pyWorkPage.Page.PageListA(1).PageListB(2).PropertyNConcetanted --> P1,P4,P5

and I have to show a string property PropertyNConcetantedTop at PageListA level which shows as pyWorkPage.Page.PageListA(1).PropertyNConcetantedTop - It should have a property that holds csv values as --> P1,P2,P3,P4,P5 without duplicates.

Can you please suggest the best approach?

***Edited by Moderator Marissa to update categories***

Comments

Keep up to date on this post and subscribe to comments

Pega
March 19, 2018 - 11:47pm

Hi NagaMrudulam,

You can try using 'pxStringCSVFromPageList' OOTB function to get CSV format string from the pagelist.

eg: @pxDataManipulate.pxStringCSVFromPageList(pyWorkPage.Page.PageListA(1).PageListB(1).PageListC,".PropertyN")  Result -  P1,P2,P3

@pxDataManipulate.pxStringCSVFromPageList(pyWorkPage.Page.PageListA(1).PageListB(2).PageListC,".PropertyN")  Result -  P1,P4,P5

Hope it helps.

Thanks.

March 22, 2018 - 10:22am
Response to Sreepriya

Hi Sreepriya_GCS,

I have done that already for the first level i.e., in PageListC.

But, I need to get the non duplicated data at PageListB level and PageListA as well. suppose from P1,P2,P3 combination and P1,P4,P5 combination we should be able to remove P1 and set the value on PageListB as P1,P2,P3,P4,P5.

Similarly at PageListA level as well.

Thanks,

Mrudula

Pega
April 11, 2018 - 12:11am
Response to NagaMrudulam

Hi NagaMrudulam,

In this case, you can run an activity and loop the pagelists to get the required properties into a dummy pagelist.

You can use a when condition on loop to check if the property is already present or not, If yes skip the step execution.

From the dummy pagelist results you can convert it into CSV format string.

Thanks.

April 2, 2019 - 4:45pm

Hi, just quick question with respect to this function, it is working for me but the quotes are put into the result CSV string.  If I try it without quotes for the property name I get error. 

April 3, 2019 - 9:08am
Response to JMark515

Hello!

 

Thank you for posting your query on PSC. This looks like an inactive post and hence, we suggest you create a new post for your query. Click on the Write a Post button that’s at the top of this screen and also on our Pega Support Community homepage.  Once created, please reply back here with the URL of the new post.

 

We have also sent you a private message opening up a communication channel in case you have any further questions.

 

Thanks,

Pallavi | Community Moderator | Pegasystems Inc.

September 17, 2019 - 12:54pm

 

Hello,

You can try to use the below for building the values for the first two strings.You can try using 'pxStringCSVFromPageList' OOTB function to get CSV format string from the pagelist.

eg: @pxDataManipulate.pxStringCSVFromPageList(pyWorkPage.Page.PageListA(1).PageListB(1).PageListC,".PropertyN")  Result -  P1,P2,P3

@pxDataManipulate.pxStringCSVFromPageList(pyWorkPage.Page.PageListA(1).PageListB(2).PageListC,".PropertyN")  Result -  P1,P4,P5

For removing the duplicates and building the value of third string you can check the below link.

https://community1.pega.com/community/pega-support/question/how-set-property-values-comma-separated-values-when-pagelist