Suppress properties in Json String
Hi All
For one of the requirements I need to send the case data to an external service as JSON String.
I am converting the whole pyWorkPage to a JSON string using below code. The conversion happens when the case is resolved.
---------------------------------
PublicAPI tools = (PegaAPI) ThreadContainer.get().getPublicAPI();
ClipboardPage stepPage = tools.getStepPage();
retValue = stepPage.getJSON(false);
------------------------------
The above code works well and returns the JSON string. Now I want to remove few Pega OOTB (Some px,py,pz properties) properties from the JSON before sending it to service.
Is there anything which Pega provides OOTB or we need to write a custom code?
I am using Pega 7.4 version.
Regards
Bhavya
Hi Bhavya,
Custom mapping of clipboard page to JSON can be achieved using JSON data transform. Some resources:
https://community.pega.com/sites/default/files/help_v81/express/procomhelpmain.htm#rule-/rule-obj-/rule-obj-model/definition.htm
https://community.pega.com/knowledgebase/articles/configuring-json-data-transform-response-data-transform-data-pages#getjson
Please note that there are some limitations with the data transform like page groups are not supported. If your use case is within the limitations you should be able to achieve it out of the box.
Thanks,
Giridhar