Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

JSON conversion of Clipboard Page

SA-26599

Summary



The user is on Pega 7.2 and have a Service REST that requires the data within a top level page on the clipboard to be transmitted back in JSON format via the response of the service. The page in question is a complex data object that in turn is composed of many other complex data objects (embedded pages) within it. The key requirement is that the JSON being passed back does not contain the pxObjClass property of the Pages within it; neither should it have any attribute in the JSON corresponding to any null/blank properties in the Clipboard Page (and embedded pages within it). 

If the mapping were being done in the connector rule itself (using the JSON drop-down option in the Map From field), it removes the it the pxObjClass property but all null/blank/uninitialized properties in the respective pages do show up as attributes in the resulting JSON. 

Similar scenario in Parse XML and XML Stream rules is handled by setting the DSS: StreamXML/DetectEmptyProperties which removes the blank properties. In this case there seems to be no mechanism to strip off the uninitialized or blank properties.


Error Messages



Not Applicable


Steps to Reproduce

  1. In the Service REST rule form use POST method. 
  2. Choose JSON in the “Map from” drop down. 
  3. Put the top level Clipboard Page in the “Map from key” field. 
  4. Pass some initialized and uninitialized properties to the REST service activity. 
  5. In this approach resulting JSON has no pxObjClass property; however all null/blank/uninitialized properties in the respective pages do show up as attributes in the resulting JSON.


Root Cause



This issue was determined to be a product enhancement request.
 

Resolution

An enhancement request, FDBK-16287, has been created for consideration by Pega Product Management. 
As local change, create a "cleaner" Function or Activity which removes all "empty" properties from the page, and call this utility as the last step in their Service's Activity.

Published August 15, 2016 - Updated October 8, 2020

Was this useful?

20% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice