The resolution talks about removing the pxObjClass using the Page-Remove method before converting to json. However removing the pxObjClass property through the activity method or through the engine api's returns the same exception - UnmodifiablePropertyException.
Is there any easy way to remove the pxObjClass property from a json?
I've not tried the regex yet, but thank you for your responses.
Also my question was assuming there is an OOTB way to do this based on the resolution provided in the article I've mentioned in my original post. But obviously that isn't the case as I've checked all possible ways (that i know of) and this isn't possible.
I stumbled upon my own post while looking for something else and thought I could update the solution in case anyone else might make use of this -
This is what I did for my use case -
e.g. If you have a top level Page and you need to convert this page to JSON
1) Create a new Data Transform and select JSON as the option instead of Clipboard
2) You can map each element 1 by 1 and you can skip the pxobjclass in your mapping
2) You can select auto map checkbox to convert all the properties on the page to json automatically and then in the setting tab, you could select on the properties to skip, the pxobjclass or any other properties that you don't want in the JSON formed.
3) Call this data transform on the context of your page to convert and pass the executionMode as SERIALIZE. The output of this rule would the jsonData param with the json string.
Posted: 3 years ago
Posted: 3 Apr 2020 7:44 EDT
Pallavi Mandal (Pallavi_Mandal)
Senior Technical Documentation Specialist