It returns a string with the JSON representation for the SDT or BC variable.
&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. |
Given the following SDT:

The result is:
{
"Name" : "Uruguay",
"Language" : "Spanish",
"Coordinates" :
{
"Latitude" : 30,
"Longitude": 35,
},
"Cities" : ["Montevideo", "Paysandu" ]
}
This method is available in Smart Devices on client-side for business components since GeneXus 16 upgrade 2.
FromJson Method
Structured Data Type (SDT) object
|