How to convert the delimited string in DSS to Value List in Pega?
We have the OOTB function “pxPageListFromStringCSV” for
converting the delimited string into Page List in Pega.I have customized the function and used for Value List.
Now let us see how we can parse the delimited (Comma Separated String) in DSS and set it in Value List property using java step in pega.
Lets get started:
I have created a DSS "MyPhrase" which contains the Comma Separated String Value.
I have also created a Value List property "PhraseStringList" of type Text in which we are going to set the Comma Separated String Values.
In the below Activity, I'm getting the Delimited CSV String from DSS and setting it in the parameter.
In below java step we are,
- Creating a new page in clipboard by using "createPage"method.
- And getting the parameter value and setting it in the string.
- By using String Tokenizer we can get the string values separated by delimited(,).
- Then adding the string token values into value list "PhraseStringList" Property in the "MyPage" new page created in the clipboard.
We can see in the Clipboard,the "MyPage" page is created and the delimited CSV String values are set in "PhraseStringList" value list property in the page.
Note : You can also use this as a function or can customize an existing function for achieving this requirement instead of using java step in your Activity.😄