Question
S&P Global Inc
US
Last activity: 11 Dec 2019 3:36 EST
Issue with setting Null Type at JSON request
Hi All,
I am consuming a Service through Connect-REST for which i have to sent value for different types of properties( Integer, Text, Boolean) which is mandatory. if i don't have value i am supposed to null with out quotes but when i am forming my request the null is going with quotes which is not accepted by service.
When i checked in JASON standard, there is some type call null to handle this. please find the below link and details for this
https://stackoverflow.com/questions/9619852/what-is-the-convention-in-json-for-empty-vs-null/9623521
"Strings, Booleans and integers do not have an 'empty' form, so there it is okay to usenull values. "JSON has a special value called null which can be set on any type of data including arrays, objects, number and boolean types."
Is it possible to achieve this in Pega? please help us on this, this is impacting our development activities. We are using Pega 7.1.7 version.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
IN
Ideally, you can send null in the JSON request. I have used multiple services set up in PEGA which take null parameters.
Ex:
......
"propname": null,
.....
Can you check if this is the format you used ? if yes, there is some other reason for the call to fail. Can you check the logs and the stack trace to debug it further.
S&P Global Inc
US
Hi Soumya,
I am trying to set my request param using the following syntax @if(@(Pega-RULES:Default).PropertyExists(.TextProperty), ".TextProperty", "null"). both LHS and RHS properties are Text Properties. my concern is values going in the request not going as follows "TextProperty": null. It is going as "TextProperty": "null".
Coforge Technologies (Erstwhile Incessant Technologies)
GB
Hi, This is expected behavior of @IF function which returns string value only. It should be explicitly set as null, not through IF function.
S&P Global Inc
US
Praveen, i don't want to set null always. Service is expecting null when there is no value for particular property. if assign the property directly its going as "TextProperty":" " which will not work out. If we set null value directly also it is going as follows "TextProperty":" ".
CollabPartnerz
IN
Hi,
If property has null then dont send that value if it is non mandatory .
S&P Global Inc
US
Hi Gayathri,
Properties are mandatory and Service is expecting null value without quots if there is no values passed to those properties.
S&P Global Inc
US
Hi @Vidyaranjan / @KipJackson_GCS,
I have not got my above mentioned query resolved, is it possible for you guys to help me on this please? Please do the needful.
S&P Global Inc
US
Hi Moderator,
Still my query not resolved with respect to this post. Please help me on this.
-
Vyas Raman Loka
Rabobank
NL
Hi , Did you get a solution for the above problem ?
Thanks
CIBC
IN
Any solution for this issue?
Pegasystems Inc.
IN
Hi @RISHAVRAJ
Thank you for posting your query in the PSC. This looks like an inactive post and hence, we suggest you create a new post for your query. Click on the Write Post button here. Once created, please reply here with the URL of the new post.
You may also refer this discussion link as a reference in the new thread.