---
title: fn::fromJSON
url: /docs/esc/environments/syntax/builtin-functions/fn-from-json/
---
The `fn::fromJSON` built-in function decodes a value from its JSON representation. This can be used to expand JSON values that are stored as scalar strings into complex values. If the input to `fn::fromJSON` is a secret, all of the decoded values are also secrets.

## Declaration

```yaml
fn::fromJSON: value-to-decode
```

### Parameters

| Property          | Type   | Description                                                       |
|-------------------|--------|-------------------------------------------------------------------|
| `value-to-decode` | string | The JSON value to decode.

### Returns

The decoded value.

## Example

### Definition

```yaml
values:
  json-object:
    fn::fromJSON: "{\"hello\": \"world\"}"
```

### Evaluated result

```json
{
  "json-object": {
    "hello": "world"
  }
}
```

