# Feedback variables with text

> From Buttons 1.9.2 a Feedback variable holds the text or number a feedback reports, such as a router selection or a tally label, not only true or false.

A Feedback variable stores the result of a feedback on the button, so you can show it in the button's text with `$(self.state.name)` or use it in an expression. How to add one is described in [Add more feedback to a button](/docs/buttons/v1.10/positions/button-feedback#show-a-live-value-from-the-device).

From Buttons 1.9.2, a Feedback variable holds **the text or number the feedback reports** whenever the feedback reports one. Only a feedback that reports nothing beyond on or off still gives `true` or `false`.

This matters most for Buttons' own feedbacks. A button can now show which source is selected in a router, which label a tally consumer shows, or why the last route failed, without an extra workflow.

## What each feedback gives

| Feedback | What the variable holds |
| --- | --- |
| **Router Context Feedback** with a label check, see below | The label, for example `HDMI 1` |
| **Router Context Feedback** with **Last Route Had Error** | The error text of the last failed route, or empty text when the last route worked |
| **Router Context Feedback** with an on/off check, such as **Has Source Selection** | `true` or `false` |
| **Tally Consumer State** | The label the consumer shows, such as `Cam 1`. A consumer without a label gives `true` or `false`. |
| **TSL Input** with **Read** set to **Label** | The label received on the channel |
| **Tieline Available Relation Count** | The number of tieline relations that are free, for example `17` |
| **Cuelist Status** | The cues that pass the check, see [Show cuelist state on buttons](/docs/buttons/v1.10/cuelists/show-cuelist-state-on-buttons) |
| A module's value feedback, such as an audio level | The value, as before |

The Router Context Feedback checks that give text are **Selection Label**, **Active Label Selection Label**, **Route State Source Label**, **Active Destinations Label**, **Bundle Label**, **Port Label**, **Device Label**, **Project Label**, **Routing Preset Label**, **Matching Preset Label**, **Match Count Label** and **Can Take**. **Can Take** gives the same text as **Match Count Label**, or `Preset` when a routing preset is selected.

## Example: show the selected source on a router key

1. Inside a **Custom Router** section, add a button. Router Context Feedback reads the router the button belongs to.
2. On the button's **Variables** tab, add a **Self** variable named `selLabel`. Set **Type** to **Feedback**, pick **Router Context Feedback**, set **Feedback** to **Selection Label** and **Side** to **Source**, and select **Create**.
3. On the **Design** tab, set the text to `$(self.state.selLabel)`.
4. Select **Apply**.

When an operator selects a source in that router, the key shows its name, for example `HDMI 1`.

<callout color="gray" title="Note">
  A label check needs the router it describes. On a button placed outside the router, the variable can't find a selection and stays `false`.
</callout>

## Update expressions that compare with true or false

An expression or condition written for earlier versions may compare one of these variables with `true` or `false`, for example `$(self.state.selLabel) == true`. From 1.9.2 the variable holds text, so that comparison is never true. Change the check to look at the text instead:

| Before | From 1.9.2 |
| --- | --- |
| `$(self.state.selLabel) == true` | `$(self.state.selLabel) != ''` |
| `$(self.state.tlcount) == true` | `$(self.state.tlcount) > 0` |

Or switch the variable to an on/off check of the same feedback, such as **Has Source Selection**, if the button only needs to know whether something is selected.

## If you get stuck

| What you see | What to try |
| --- | --- |
| The variable shows `false` although a source is selected. | The button is outside the router the check reads. Move it into the **Custom Router** section, or use a check that works anywhere. |
| The variable shows `true` or `false`, not a label. | The check you picked is an on/off check. Pick one of the label checks listed above. |
| A condition that used to work never runs. | It compares the variable with `true`. See [Update expressions that compare with true or false](#update-expressions-that-compare-with-true-or-false). |
