Question

3
Replies
697
Views
Brahmeswara Rao (Brahmesh@)
Capgemini
Developer
Capgemini
SE
Brahmesh@ Member since 2013 154 posts
Capgemini
Posted: March 20, 2020
Last activity: March 24, 2020
Posted: 20 Mar 2020 10:21 EDT
Last activity: 24 Mar 2020 9:49 EDT
Closed

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              } }

updated

 

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              } }

updated

 

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 .

JSON

2.2) Map the param.jsonData to .pyJsonData 

2.3) In the response tab , configured Map from "Clipboard" and Map from key .pyJsonData 

 

Pega Platform 7.3.1 Data Integration Java and Activities System Administration Financial Services
Moderation Team has archived post, This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.