![]() ![]() |
Reference Type: Supported, Category: JSON Conversion Functions, ICR#: 6682
The DECODE^XLFJSON API converts a JSON object into a closed array reference.
NOTE: This API was released with Kernel Patch XU*8.0*680.
DECODE^XLFJSON (xujson,xuroot[,xuerr])
xujson: |
(required) A string or array containing a serialized JSON object. |
xuroot: |
(required) A closed array reference for M representation of the object. |
xuerr: |
(optional) This contains error messages. If not defined, defaults to ^TMP(“XLFJERR”,$J). |
>S INJSON(1)="{""menu"":{""id"":""file"",""popup"":{""menuitem"":[{""value "": ""New"",""onclick"":""CreateNewDoc()""}," >S INJSON(2)="{""value"": ""Open"",""onclick"": ""OpenDoc()""},{""value"": ""Close"",""onclick"": ""CloseDoc()""}]} ," >S INJSON(3)="""value"":""File""}}" >D DECODE^XLFJSON("INJSON","OUTJSON","ERRORS") >ZW OUTJSON OUTJSON("menu","id")="file" OUTJSON("menu","popup","menuitem",1,"onclick")="CreateNewDoc()" OUTJSON("menu","popup","menuitem",1,"value")="New" OUTJSON("menu","popup","menuitem",2,"onclick")="OpenDoc()" OUTJSON("menu","popup","menuitem",2,"value")="Open" OUTJSON("menu","popup","menuitem",3,"onclick")="CloseDoc()" OUTJSON("menu","popup","menuitem",3,"value")="Close" OUTJSON("menu","value")="File" |