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

# Table setup fields

> Configure table names, visibility, downloaded columns, and row identity.

# Table setup fields

## `tableName`

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "tableName": "Production Unit"
}
```

The exact name of the source table.

It must match the setup record's `Table Name` exactly.

Use the real source-table name rather than a friendly, translated, abbreviated, or reformatted version.

For example, if the actual source table is:

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
Production Unit
```

do not configure it as:

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
Production Units
production_unit
production unit
```

***

## `visible`

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "visible": true
}
```

Controls whether the table appears in the app's table list.

| Value   | Behaviour                    |
| ------- | ---------------------------- |
| `true`  | Table is visible by default. |
| `false` | Table is hidden by default.  |
| omitted | Table is visible by default. |
| `null`  | Table is visible by default. |

> **Important:** `visible` is a navigation setting, not a security control.

A table that is hidden from the table list may still be downloaded and used as reference data.

Use the source database's permissions to protect sensitive information.

***

## `requestColumns`

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "requestColumns": [
    "@row.id",
    "Id",
    "Name",
    "Barcode"
  ]
}
```

`requestColumns` defines the fields the app requests and stores locally for the table.

This is the most important field to maintain correctly.

Include every source field required by any app feature that uses the table.

This can include:

* table screens;
* dropdowns;
* multi-select references;
* barcode scanning;
* smart scanning;
* dependent dropdown filters;
* reports;
* `LOOKUP` formulas;
* posting values into another form or table;
* reference matching;
* reference display values.

Column names must match the source table exactly.

If a field is not included in the effective requested columns, the app cannot reliably use that field later even if the field exists in the source database.

***

### Always include `@row.id`

Every downloaded table should include:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
"@row.id"
```

`@row.id` is the unique source-row identifier used by the app to keep downloaded rows separate.

It may be hidden from the table screen, but it is still required in the downloaded data.

### `Id` and `@row.id` are different

Do not treat these fields as interchangeable.

| Field     | Purpose                                                                           |
| --------- | --------------------------------------------------------------------------------- |
| `@row.id` | Unique row identity used by the app's local table data.                           |
| `Id`      | Ordinary source-table field that may be used as a business or posting identifier. |

An `Id` field does **not** replace `@row.id`.

***

### Reference-table columns

When a table is used as reference data, include both:

1. the value displayed to the user; and
2. the value returned or posted when the user makes a selection.

For example:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "requestColumns": [
    "@row.id",
    "PU_ID",
    "Description"
  ]
}
```

A reference component might display:

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
Description
```

while posting:

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
PU_ID
```

Both fields therefore need to be downloaded.

***
