> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/flow/tutorials/components/metric.md).

# Metric

Step-by-step tutorials for the Avonni Metric in screen flows: a live KPI from a query, money and date formats, a trend against a target, a clickable number.

The [Metric](https://docs.avonnicomponents.com/flow/flow-components/metric.md) puts one number or date on a flow screen, with a label, a secondary value and a trend color. These tutorials follow one example: a sales manager checking this quarter's won revenue and the deals closing this week before submitting a forecast.

{% hint style="info" %}
New to the component? Start with [Show a KPI from a query](https://docs.avonnicomponents.com/flow/tutorials/components/metric/show-a-kpi-from-a-query.md). The other tutorials reuse its flow and data.
{% endhint %}

## Show a number

Get the right value on the screen, then make it read the way your users expect.

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Show a KPI from a query</strong></td><td>Show this quarter's won revenue on a flow screen, summed live from Opportunities by the Metric's own query, with no Get Records or loop.</td><td><a href="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2Fzzwes95O26HGa3I75eX6%2Fmetric-cover-show-a-kpi-from-a-query.png?alt=media">metric-cover-show-a-kpi-from-a-query.png</a></td><td><a href="https://docs.avonnicomponents.com/flow/tutorials/components/metric/show-a-kpi-from-a-query.md">Show a KPI from a query</a></td></tr><tr><td><strong>Format money, percent and dates</strong></td><td>Format a Metric as money with the right currency, as a percent that reads as the user expects, or as a date, using Format Style and its options.</td><td><a href="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FIh2oMol5JDCudNcwqTwZ%2Fmetric-cover-format-money-percent-and-dates.png?alt=media">metric-cover-format-money-percent-and-dates.png</a></td><td><a href="https://docs.avonnicomponents.com/flow/tutorials/components/metric/format-money-percent-and-dates.md">Format money, percent and dates</a></td></tr></tbody></table>

## Compare and react

Tell the user whether the number is good news, and let them click it to see what is behind it.

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Add a trend against a target</strong></td><td>Color a Metric red or green against a quarterly target with Show Trend Color, and show the target or the gap next to it as a secondary value.</td><td><a href="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FEuwKOx1vcD0CNDwSKPqQ%2Fmetric-cover-add-a-trend-against-a-target.png?alt=media">metric-cover-add-a-trend-against-a-target.png</a></td><td><a href="https://docs.avonnicomponents.com/flow/tutorials/components/metric/add-a-trend-against-a-target.md">Add a trend against a target</a></td></tr><tr><td><strong>Branch the flow on a metric click</strong></td><td>Make a Metric clickable so a click on the number takes the user to a screen with the records behind it, using Flow Navigation and a Decision.</td><td><a href="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FjtsCBoh8XDeZYVywK5iU%2Fmetric-cover-branch-the-flow-on-a-metric-click.png?alt=media">metric-cover-branch-the-flow-on-a-metric-click.png</a></td><td><a href="https://docs.avonnicomponents.com/flow/tutorials/components/metric/branch-the-flow-on-a-metric-click.md">Branch the flow on a metric click</a></td></tr></tbody></table>

Want the full property list? See the [Metric](https://docs.avonnicomponents.com/flow/flow-components/metric.md) reference.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.avonnicomponents.com/flow/tutorials/components/metric.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
