> ## Documentation Index
> Fetch the complete documentation index at: https://docs.falkordb.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> FalkorDB is a graph database that speaks the Redis protocol. Queries are issued as OpenCypher through the GRAPH.QUERY and GRAPH.RO_QUERY commands, not over Bolt or a SQL connection.
> FalkorDB implements a subset of OpenCypher with proprietary extensions. Do not assume Neo4j-only syntax or procedures are available — check /cypher/cypher-support and /cypher/known-limitations before using a clause.
> FalkorDB is the successor to RedisGraph, but they are separate products. Do not present RedisGraph commands, versions, or limitations as current FalkorDB behavior.
> Use the official clients listed in /getting-started/clients rather than generic Redis or Neo4j drivers, and prefer the language the user is already working in.
> Configuration parameters are set with GRAPH.CONFIG SET or at startup; cite the exact parameter name from /getting-started/configuration rather than inventing one.
> This site covers four products: FalkorDB (core), FalkorDB Cloud, FalkorDB Enterprise, and the GraphRAG SDK. Name which one an answer applies to, since setup and operations differ.

# json.fromJsonList

> Parses a JSON string and returns it as a list, returning an empty list on parse errors.

## 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

```cypher theme={null}
flex.json.fromJsonList(jsonString)
```

## Parameters

| Parameter    | Type   | Required | Description                         |
| ------------ | ------ | -------- | ----------------------------------- |
| `jsonString` | string | Yes      | A JSON string representing an array |

## 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

```cypher theme={null}
WITH '[1, 2, 3, 4, 5]' AS json
RETURN flex.json.fromJsonList(json) AS numbers
```

**Output:**

```text theme={null}
numbers
-----------
[1, 2, 3, 4, 5]
```

### Example 2: Parsing Complex Arrays

```cypher theme={null}
WITH '[{"id":1,"name":"Alice"},{"id":2,"name":"Bob"}]' AS json
WITH flex.json.fromJsonList(json) AS users
UNWIND users AS user
RETURN user.id, user.name
```

### Example 3: Processing Stored List Data

```cypher theme={null}
MATCH (p:Product)
WHERE p.tagsJson IS NOT NULL
WITH p, flex.json.fromJsonList(p.tagsJson) AS tags
UNWIND tags AS tag
RETURN p.name, tag
```

### Example 4: Handling Malformed JSON

```cypher theme={null}
WITH '[invalid, json]' AS badJson
RETURN flex.json.fromJsonList(badJson) AS result
```

**Output:**

```text theme={null}
result
------
[]
```

(Returns empty list for invalid 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](/udfs/flex/json/fromJsonMap) - Parse JSON string to map
* [json.toJson](/udfs/flex/json/toJson) - Serialize value to JSON string

## Frequently Asked Questions

<AccordionGroup>
  <Accordion title="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.
  </Accordion>

  <Accordion title="Can I parse nested JSON arrays?">
    Yes. The function parses the full JSON structure including nested arrays and objects within the list elements.
  </Accordion>
</AccordionGroup>
