***

title: output
slug: /reference/python/agents/data-map/output
description: Set the output template for a webhook.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[functionresult]: /docs/server-sdks/reference/python/agents/function-result

[ref-datamap]: /docs/server-sdks/reference/python/agents/data-map

[fallback-output]: /docs/server-sdks/reference/python/agents/data-map/fallback-output

Set the output for the most recently added webhook. The
[`FunctionResult`][functionresult] template
is filled with response data after the API call succeeds.

<Tip>
  Always set a [`fallback_output`][fallback-output] so the AI has something meaningful
  to say even when external APIs are unavailable.
</Tip>

## **Parameters**

<ParamField path="result" type="FunctionResult" required={true} toc={true}>
  A FunctionResult defining the response template. Use `${response.field}` to
  reference API response fields.
</ParamField>

## **Returns**

[`DataMap`][ref-datamap] -- Self for method chaining. Raises `ValueError` if no webhook has been
added yet.

## **Example**

```python {5}
from signalwire import DataMap, FunctionResult

dm = DataMap("get_weather")
dm.webhook("GET", "https://api.weather.com/v1/current")
dm.output(FunctionResult("The weather is ${response.current.condition.text}."))
```