Requirement to set a blank string value to null in REST Service response
Requirement is to set a blank value to null in outbound response of the Service-REST
The blank value of Text properties are set to “” instead null
For integer/decimals it's setting null ( as expected )
Pega Service Response :-
Actual Response
{ "Application":{ "Status":"Pending-Review", "ApplyingWith":"", "InterestRate":null, "StreetAddress":"" } }
Expected :-
{ "Application":{ "Status":"Pending-Review", "ApplyingWith":null, "InterestRate":null, "StreetAddress":null } }
I don't want to use below function which removes the blank properties from the JSON but we need blank values with null ( not "")
@(Pega-RULES:Page).pxConvertPageToString(tools, myStepPage, "json")
Requirement is to set a blank value to null in outbound response of the Service-REST
The blank value of Text properties are set to “” instead null
For integer/decimals it's setting null ( as expected )
Pega Service Response :-
Actual Response
{ "Application":{ "Status":"Pending-Review", "ApplyingWith":"", "InterestRate":null, "StreetAddress":"" } }
Expected :-
{ "Application":{ "Status":"Pending-Review", "ApplyingWith":null, "InterestRate":null, "StreetAddress":null } }
I don't want to use below function which removes the blank properties from the JSON but we need blank values with null ( not "")
@(Pega-RULES:Page).pxConvertPageToString(tools, myStepPage, "json")
2) Even followed the local changes mentioned here but didn't help
2.1) convert the page to json using data transform .
2.2) Map the param.jsonData to .pyJsonData
2.3) In the response tab , configured Map from "Clipboard" and Map from key .pyJsonData