# decode_multi_select_answer

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/_ask_user_types/decode_multi_select_answer)

Decode a `multi_select` answer produced by `encode_multi_select_answer`.

## Signature

```python
decode_multi_select_answer(
    raw: str,
) -> list[str] | None
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `raw` | `str` | Yes | The raw answer string for a `multi_select` question. Must already be a `str`: a non-string raises `TypeError` out of `json.loads` rather than returning `None`. Every call site establishes that first — `_parse_answers` coerces non-string answers, `_validated_ask_user_answers` checks `isinstance(answer, str)`, and the display path passes a slice of the transcript. |

## Returns

`list[str] | None`

The selected values, or `None` when `raw` is not a JSON array of
strings. Callers choose the policy for `None`; the one thing none of
them may do is fall back to splitting on `", "`, which mis-splits a
value that contains a comma.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/caaa7e7c12d214afa5cf0a1afed8eb6232aa6f7b/libs/code/deepagents_code/_ask_user_types.py#L93)