> ## Documentation Index
> Fetch the complete documentation index at: https://docs.terminus.app/llms.txt
> Use this file to discover all available pages before exploring further.

# QR Code field

> A computed field that produces a downloadable QR-code image encoding another field's value, usually a record's short URL.

<Info>
  A QR Code is a computed field. For each record it produces a downloadable QR image that encodes the value of another field on the same row, usually the record's [Short URL](/reference/fields/short-url). You point it at a source field, optionally give it a caption field, and optionally choose a [QR Style](#qr-styles) for its look. Terminus generates the image for you, you do not type anything into a QR Code field.
</Info>

## When to use it

* Print collateral (posters, flyers, packaging, signage) that should link back to a trackable short URL.
* Anywhere a person scans instead of clicks, and you want scans and clicks to stay distinguishable in [analytics](/guides/analytics).
* Any time you want a ready-to-download QR image attached to a record without running a separate QR service.

<Warning>
  Don't use it for arbitrary strings unrelated to a record. A QR Code always encodes the resolved value of another field on the same row. To make a QR for a destination, add the destination as a field first (typically a [Short URL](/reference/fields/short-url)) and point the QR Code at it.
</Warning>

## How it works

Each time the submission is saved, the QR Code recalculates from its source:

1. It reads the value of the field set in `source_field_id`. If that value is blank, the QR Code stays empty.
2. If the source is a Short URL field, it appends a `?qr` marker to the URL before encoding it. That marker is what lets analytics tell a QR scan apart from a click on the same short link. See [tracking](#scan-tracking).
3. If `label_field_id` is set, it reads that field's value to show as a caption beneath the image. The caption is not encoded into the QR payload, scanners still land on the source value.
4. It produces the QR image, styled by the chosen [QR Style](#qr-styles) (or your account default).

A QR Code field is read-only in the form and the grid. Where it appears, you get a "View QR code" button that opens a dialog to preview and download the image.

## Settings reference

| Setting           | Required | Default         | Description                                                                                                                                                                                                                                            |
| ----------------- | -------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `source_field_id` | Yes      | None            | The field whose resolved value is encoded into the QR image. Usually a [Short URL](/reference/fields/short-url) field so scans stay separable from clicks. Cannot point at another QR Code or a Constant field.                                        |
| `label_field_id`  | No       | None            | Optional field whose value is shown as a caption underneath the image. Not part of the scanned payload.                                                                                                                                                |
| `qr_style_id`     | No       | Account default | Optional [QR Style](#qr-styles) for the visual design. Omit it to follow the account default, which means the look updates automatically if an admin changes the default. Set it to pin a specific style that stays put even when the default changes. |

A QR Code field has no prefix or suffix, and its size and image format are chosen at download time, not in these settings.

## Example

The `qr_code` field from the [computed-fields tutorial](/tutorial/07-computed-fields), pointed at the campaign's short URL:

```yaml theme={null}
name: QR Code
type: qr_code
computed: true
settings:
  source_field_id: short_url   # the Short URL field on this row
```

For a record whose short URL resolves to `https://ter.li/aB3xK9`, the QR Code encodes `https://ter.li/aB3xK9?qr`. Someone who scans the printed code lands on the same shortener, but the `?qr` marker records the visit as a scan rather than a click.

## QR Styles

The visual design of a QR image (dot and corner shapes, colors and gradients, a logo, an optional "SCAN ME" frame, and caption styling) comes from a **QR Style**. QR Styles are account-level and managed by account admins under **Settings**, so the same brand look can be reused across every QR Code field in your account.

You do not design styles on the field. You only pick one in `qr_style_id`, or leave it blank to use the account default. Every account starts with a built-in default style, and there is always exactly one default. Admins can create more styles from a few starter templates and mark a different one as the default.

## Downloading a QR image

A QR Code field shows a "View QR code" button in the record grid and in the submission builder. The dialog lets you:

* Pick a size: 300, 500, 1000, or 2000 px (with a hint for what each suits, from screen and email up to posters and billboards).
* Pick a format: `PNG`, `JPEG`, `SVG`, or `PDF`.
* Preview the image, then download it.

The preview and download use the field's configured QR Style.

<a id="scan-tracking" />

## Scan tracking

When the source is a Short URL, the encoded link carries a `?qr` marker, so a scan is recorded as a scan, distinct from a click on the short link elsewhere. You can see scans and clicks separately in [analytics](/guides/analytics). If you point a QR Code at a plain URL instead of a Short URL, the marker is not added and scans will not be separable from clicks.

## Gotchas

* **Point the source at a Short URL, not a plain URL.** The `?qr` scan marker is only added when the source is a Short URL field. A plain URL still works, but scans will not be distinguishable from clicks in [analytics](/guides/analytics), and edits to that URL flow straight into the QR, which can leave already-printed codes pointing somewhere stale.
* **A blank source means a blank QR.** If the source field has no value on a record, that record's QR Code produces nothing. There is no error, just no image.
* **The caption is not scanned.** `label_field_id` only sets the text printed beneath the image. Scanners still land on the source field's value.
* **Style is chosen, not validated.** `qr_style_id` references an account-level QR Style. Its existence is not checked when you save the field, so a style that no longer exists falls back to the account default rather than breaking. Previously printed or embedded QR images keep working even if their style is later deleted.
* **Size and format live on the download, not the field.** You choose them in the View QR code dialog each time you download. The field settings hold only the source, caption, and style.

## Related

* [Short URL field](/reference/fields/short-url): the usual source for a QR Code.
* [Analytics](/guides/analytics): where QR scans show up, tracked separately from link clicks.
