---
title: Has field
description: Display records that point back to the current record.
---

A Has field represents a reverse relation, such as the posts that point back to
an author. The declaration identifies the related resource and the field that
displays each related record.

## API

```ts
fields.has(
  name,
  () => resource,
  options: HasFieldOptions & { display: string | FieldBuilder }
)
```

| Option        | Input                   | Result                                    |
| ------------- | ----------------------- | ----------------------------------------- |
| `display`     | `string`, field builder | Displays through a target resource field. |
| `label`       | `string`                | Sets the text shown for the field.        |
| `description` | `string`                | Adds supporting text for the label.       |
| `cardinality` | `one`, `many`           | Declares one or many reverse relations.   |

`configure(options)` returns a configured clone. `clone()` returns an
independent copy with the same relation declaration and options. `configure` can replace the display field. The target resource stays fixed.

A Has field does not use a lookup target. A reverse relation is shown in a form
but is not edited as one input.

## Basic Has field

Pass the related records as an array. The display field reads each record.

<BacklitExample path="fields/has/basic" view="detail" />

## Description

<BacklitExample path="fields/has/description" view="detail" />

## Display link

Configure the display field with `link` to make every related record link to
its target view.

<BacklitExample path="fields/has/display_link" view="detail" />

## Cardinality

Cardinality declares whether one or many records point back. Has data is
supplied as a related record set.

<BacklitExample path="fields/has/cardinality" view="detail" />

## Clone

Use `configure` to add a link for one context without changing the
shared field.

<BacklitExample path="fields/has/clone" view="detail" />

## All options

A Has field can use a linked display field, metadata, and many cardinality
together.

<BacklitExample path="fields/has/all_options" view="detail" />

Supply an array of related records for both cardinalities. Use an empty array
for no related records. `cardinality: 'one'` changes the declaration; it does
not change the array input that the current Has builder reads.
