Set null
Hello!
How to set null in variable?
I need to create JSON like below:
{
"id":"1",
"Code": null
}
Discussion (3)0
Comments
set t={"id":"1","Code": 2}
write t.%ToJSON(),!
do t.%Set("Code","","null")
write t.%ToJSON()
Thanks, it works
Set Property Parameter %JSONNULL = 1
Property Code As %String(%JSONNULL = 1);Code = "" >>> "Code":null
Code =$c(0) >>> "Code":""