# from\_json

Source: https://zotonic.com/docs/2425/from_json

URI: https://zotonic.com/id/2425

Language: en



Parse a string as a JSON (JavaScript Object Notation) value. The returned value can be processed futher.

For example:

```django
{{ "[1,2,3]"|from_json|first }}
```

Converts this JSON string to a list of integers and displays the first result:

```django
1
```

Another example with a string that parses to a structured value:

```django
{% with '{ "a": "Hello", "b": 2 }'|from_json as obj %}
    {% print obj.a %}
{% endwith %}
```

This will display:

```django
Hello
```

If the given value can not be parsed as JSON then it is silently mapped to `undefined`.

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/2425?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/2425?language=en>)
