How can handle null value while passing json data with converting a!tojson() format ?

Hi All,

I am facing below issue while trying to passed formatted json (a!fromJson()) data as parameter and again converting same json date using a!toJson() format at that time of passing the parameter.

Please find the below code sample and share me if any solution.

step1- Finding enter json data

local!jsonData: if(a!isNullOrEmpty(ri!jsonData),
{},
a!fromJson(ri!jsonData)
),

step2 -  Binging with local variable 

local!exceptionResults:property(local!jsonData, "ScreeningSummary", null),

step3-  Passing the local variable with using a!toJson to child interface (rule!PM_ScreeningExceptionSummary)

rule!PM_ScreeningExceptionSummary(a!toJson(local!exceptionResults)),

Step 4- Binding Json preparties within the Appain ready only grid


a!localVariables(
local!exceptionResultsFound: if(
a!isNullOrEmpty(ri!exceptionResults),
{},
a!fromJson(ri!exceptionResults)
),
{
a!sectionLayout(
label: "Exceptions",
labelSize: "SMALL",
contents: {
a!gridField(
data: local!exceptionResultsFound,
columns: {
a!gridColumn(
label: "Screening Services",
value: fv!row.ScreeningService
),
a!gridColumn(
label: "Exception Found",
value: fv!row.ExceptionMessage
)
},
validations: {}
)
},
)
},
)

Error Screenshot 


Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error at function a!toJson [line 420]: The value parameter must not be null.

Note:- Maybe some time my json contain null value. and not storing in CDT .

Json with value


{
"ScreeningSummary": [
{
"ScreeningService": "Service1",
"ExceptionMessage": "Message1"
},
{
"ScreeningService": "Service2",
"ExceptionMessage": "Message2"
},
{
"ScreeningService": "Service3",
"ExceptionMessage": "Message3"
},
{
"ScreeningService": "Service4",
"ExceptionMessage": "Message4"
}
]
}

Json with null value 

"ScreeningSummary": null

  Discussion posts and replies are publicly visible

Parents Reply Children
No Data