FromJson Method

Official Content
This documentation is valid for:

Receives a JSON string from which the SDT is loaded. 

Syntax

[&Boolean =] &SDT.FromJson(&String[, &Messages])

Type returned:

The type returned is a Boolean. It returns False in case of having an error, otherwise it returns True.

Assigning the return value is optional. 

Where:

&String
    Attribute or variable string.
 
&SDT
    Variable based on SDT.
 
&Messages
   Variable based on GeneXus's Messages data type. In case of an error it contains the error information. This Parameter is optional.  

Description

It loads the &SDT structure from the &String variable content. This variable's JSON format must be compatible with the SDT's structure.

Technical Details

Data Type Mapping

The GeneXus basic data types are mapped to JSON data types in this way:

Character, VarChar, LongVarChar --> JSON string

Boolean --> JSON Boolean

Numeric --> JSON Number

Collections --> an ordered sequence of values, comma-separated and enclosed in square brackets

Ignored SDT Properties

The following properties are ignored in the process of serializing an SDT to JSON:

  • XML Type
  • XML Name
  • XML Namespace
  • SoapType

References

Scope

Objects ProcedureTransactionWeb Panel, Panel for Smart Devices
Lenguages .NET, Java.


See Also

ToJson 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.