ToJson Method

Official Content

It returns a string with the JSON representation for the SDT or BC variable. 

Syntax

&String = &SDT.ToJson([&Boolean])

Where:

&String
    Attribute or variable string.
 
&SDT
    Variable based on SDT.
 
&Boolean
     Optional parameter: It only applies to Business Component variables. If true, then the returned string contains the auxiliary variables (old values, mode, initialized flag). Otherwise, it only contains the record data. The default value is true.

Sample

Given the following SDT:

CountrySDT

The result is:

{
"Pais":
   {
    "Country" : "Uruguay",
    "Language" : "Spanish",
    "Coordinates" : 
        {
         "Latitude" : 30,
         "Longitude": 35,
	}
    "Cities" : 
        {
           "Item" : ["Montevideo", "Paysandu" ]
	}
    }
}

 

Scope

Objects ProcedureTransactionWeb Panel
Lenguages .NET, Java.

See Also

FromJson Method
Structured Data Type Object

Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.