Description
Parses a JSON string and returns it as a list (array). Safely handles malformed JSON by returning an empty list on parse errors.Syntax
Parameters
Returns
Type: list A list parsed from the JSON string. Returns an empty list[] if parsing fails or if the input is not a valid JSON array.
Examples
Example 1: Basic JSON Array Parsing
Example 2: Parsing Complex Arrays
Example 3: Processing Stored List Data
Example 4: Handling Malformed JSON
Notes
- Returns empty list
[]if input is not valid JSON - Returns empty list if the JSON represents a non-array value (e.g., object, string)
- Safe to use without error handling as it won’t throw exceptions
- Useful for parsing list data, batch imports, or stored JSON arrays
See Also
- json.fromJsonMap - Parse JSON string to map
- json.toJson - Serialize value to JSON string
Frequently Asked Questions
What does flex.json.fromJsonList return for invalid JSON?
What does flex.json.fromJsonList return for invalid JSON?
It safely returns an empty list
[] without throwing an exception, making it safe to use without error handling.Can I parse nested JSON arrays?
Can I parse nested JSON arrays?
Yes. The function parses the full JSON structure including nested arrays and objects within the list elements.