> ## 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.

# Configuration patterns

> Use recommended patterns for active, hidden, and role-specific table configurations.

# Recommended configuration patterns

## Active reference table

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "tableName": "Production Unit",
  "visible": true,
  "requestColumns": [
    "@row.id",
    "PU_ID",
    "Description",
    "Active"
  ],
  "queryFilter": "[Active] = true"
}
```

This pattern is appropriate for a reference table where only active records should be available to the app.

If users do not need to open the table directly, it may still be downloaded and used as reference data.

`visible` controls whether the table appears in the table list; it does not determine whether the data can be used as downloaded reference data.

***

## Hidden reference table

If a table is needed only by components and users do not need to browse it directly:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "tableName": "Production Unit",
  "visible": false,
  "requestColumns": [
    "@row.id",
    "PU_ID",
    "Description",
    "Active"
  ],
  "queryFilter": "[Active] = true"
}
```

The table can remain available as locally downloaded reference data while being hidden from the table list.

Remember that this is a navigation choice, not a security boundary.

***

## Role-specific additional fields

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "tableName": "Staff",
  "visible": true,
  "requestColumns": [
    "@row.id",
    "Id",
    "Full Name & ID",
    "Production Unit",
    "Barcode Text"
  ],
  "roleAccess": [
    {
      "role": "B. Farmtrace Developers",
      "isAllowedToView": true,
      "addedColumns": [
        "Email",
        "Phone"
      ],
      "hideColumns": []
    }
  ]
}
```

Users with the `B. Farmtrace Developers` role download:

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
@row.id
Id
Full Name & ID
Production Unit
Barcode Text
Email
Phone
```

Other roles use the base `requestColumns` unless another matching role rule exists.

***

## Different fields for different roles

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "tableName": "Staff",
  "visible": true,
  "requestColumns": [
    "@row.id",
    "Id",
    "Full Name & ID",
    "Production Unit",
    "Barcode Text",
    "Phone"
  ],
  "roleAccess": [
    {
      "role": "B. Farmtrace Developers",
      "isAllowedToView": true,
      "addedColumns": [
        "Email"
      ],
      "hideColumns": []
    },
    {
      "role": "Field Operators",
      "isAllowedToView": true,
      "addedColumns": [],
      "hideColumns": [
        "Phone"
      ]
    }
  ]
}
```

Before hiding `Phone` for `Field Operators`, confirm that no feature available to that role depends on `Phone`.

This includes:

* forms;
* reports;
* lookups;
* scans;
* dropdowns;
* filters;
* posting actions.

***
