Support Article
Dump Characters set to the JSON request
SA-60804
Summary
Dump characters are set to the JSON request when using the pxConvertPageToString out-of-the-box function.
Error Messages
Not Applicable
Steps to Reproduce
- Create a main page with a page list.
- Convert the main page to a JSON object using pxConvertPageToString out-of-the-box function.
Root Cause
For a few scenarios, JSON object has dump characters (such as alphanumeric characters) instead of attributes.
For example,
The expected format is: "PropertyrDetails":{"Property1":""4545",""Property2":"xyz"}
However, JSON object is created in the format: {"3":{"Property1":""4545",""Property2":"xyz"}
Resolution
Perform the following local-change:
Include the below Java code in the activity instead of the pxConvertPageToString function:
PublicAPI tools = (PegaAPI) ThreadContainer.get().getPublicAPI();
ClipboardPage stepPage = tools.getStepPage();
String retValue = stepPage.getJSON(false);
return retValue;
Published September 18, 2018 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.