We are using the OOB function pxConvertPageToString to convert list of properties into JSON, for instance a list of languages. If we post two languages, it converts them and later they got saved into external DB without any issues, however if we have more than two, they are not getting saved, still only two. Has anybody experienced such behavior? Can somebody give an advise of how to resolve it?
***Edited by Moderator Marissa to update Content Type from Discussion to Question***
I cannot help with this issue, but I can recommend you try with JSON data transform approach to serialize/deserialize a page. If you go with this approach, you will also have more control over how the object is serialized or deserialized.
Posted: 1 year ago
Posted: 25 Jan 2021 23:29 EST
Larisa Kerimbekova (lkerimbe)
I second the suggestion to look into adopting JSON Data Transforms for exchanging between Clipboard data and JSON messages. You run the risk of pxConvertPageToString changing an aspect of its behavior in future releases.
Start with Data transform actions for JSON on Pega Community, in particular the Append and Map to action. The idea is that the configuration experience is similar to a normal Data Transform, but instead of mapping between two Classes, you map between a Class and a JSON structure.
When executed with the executionMode parameter set to SERIALIZE, the configuration converts the Primary Page to a JSON message according to the configuraiton in the rule, returning the result in the jsonData parameter. As such you will need to "Pass the current parameter page" from the calling rule, so that the calling rule can access Param.jsonData.
Hopefully that gets you moving in the right direction.