JSON Syntax rules
The JSON syntax is a subset of the JavaScript object representation syntax.
• Data in name/value pairs
• Data separated by commas
• Curly Braces Save objects
square brackets to save an array
JSON value
The JSON value can be:
• Number (integer or floating-point)
• String (in double quotes)
• Logical value (TRUE or FALSE)
• Array (in square brackets)
• Objects (in curly braces)
NULL
Jsonobject = {
"Employees": [
{"FirstName": "John", "LastName": "Doe"},
{"FirstName": "Anna", "LastName": "Smith"},
{"FirstName": "Peter", "LastName": "Jones"}
],
"Employees2": [
{"FirstName": "John", "LastName": "DOESDGD"},
{"FirstName": "Anna", "LastName": "Smith"},
{"FirstName": "Peter", "LastName": "Jones"}
]
}
In the example above, the object "Employees" is an array that contains three objects.
Use method: Jsonobject.employees[0].lastname result is Doe