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

# Component fields

> Configure the setup keys read by Dsync dynamic components.

Use these keys inside each object in a form's `components` array. This page covers the fields read from function setup; runtime state and local serialized property names are intentionally omitted.

## Identity and posting

| Key             | Type   | Default              | Use                                                                                                                             |
| --------------- | ------ | -------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `compType`      | string | `textinput` fallback | Selects the renderer. See [Component types](/dsync/function-setup/component-types).                                             |
| `compId`        | string | `""`                 | Stable component ID used by calculated values and component references.                                                         |
| `compIdFB`      | string | `""`                 | ID of the parent component for conditional visibility.                                                                          |
| `postTargetCol` | string | `"No Value"`         | Destination column for the component's submitted value. Components without a valid target are not included in normal form data. |
| `displayCol`    | string | `"No Value"`         | Column from a reference row to show as the user-facing label.                                                                   |
| `postValueCol`  | string | `"No Value"`         | Column or value to return from a reference selection or match.                                                                  |
| `linkTable`     | string | `"No Value"`         | Destination table for related rows created by a `multi-reference` component.                                                    |
| `refTable`      | string | `"No Value"`         | Downloaded table used by reference-backed components.                                                                           |

For input components, `postTargetCol` is the important posting key. For reference-backed components, configure `refTable`, `displayCol`, and `postValueCol` together.

## Labels, values, and validation

| Key                 | Type    | Default      | Use                                                                                                                  |
| ------------------- | ------- | ------------ | -------------------------------------------------------------------------------------------------------------------- |
| `dispMessage`       | string  | `""`         | Label, hint, or display text shown for the component.                                                                |
| `componentHintText` | string  | `""`         | Supporting text shown below text-like inputs.                                                                        |
| `defaultValue`      | string  | `""`         | Initial or calculated value. Supports raw text and `${comp.id}`, `${form.Column}`, or named formula placeholders.    |
| `required`          | boolean | `false`      | Requires a visible component value before the form can submit.                                                       |
| `isMultiLine`       | boolean | `false`      | Allows multiple lines for text-like inputs.                                                                          |
| `minValue`          | string  | `"No Value"` | Minimum value text. It is used as a numeric bound by `numberpicker` and may be supplied to numeric workflows.        |
| `maxValue`          | string  | `"No Value"` | Maximum value text. It is used as a numeric bound by `numberpicker` and may be supplied to numeric workflows.        |
| `fbRegex`           | string  | `""`         | Regular expression used by conditional visibility and scan-specific validation flows.                                |
| `visible`           | boolean | `true`       | Shows or hides the component. Hidden components are skipped during submission unless `useNonVisibleValue` is `true`. |
| `readOnly`          | boolean | `false`      | Prevents editing for supported text-like and picker components.                                                      |
| `isStatic`          | boolean | `false`      | Marks the component as static in the parsed configuration.                                                           |

Use `compIdFB` and `fbRegex` together for conditional visibility. A child component is hidden when its parent's current value matches the child's regular expression.

## Reference lists and filters

| Key                 | Type                   | Default      | Use                                                                                                    |
| ------------------- | ---------------------- | ------------ | ------------------------------------------------------------------------------------------------------ |
| `dataset`           | array of objects       | `[]`         | Options for `customdropdown`. Each object uses `value` for the label and `id` for the submitted value. |
| `compList`          | comma-separated string | `""`         | Component IDs whose calculated values can replace `<!componentId!>` placeholders in `defaultValue`.    |
| `filterTable`       | comma-separated string | `"No Value"` | Filter key or keys used to restrict rows from `refTable`. Pair them with `filterRefCol`.               |
| `filterRefCol`      | comma-separated string | `"No Value"` | Reference-table column or columns compared with the active filter values.                              |
| `filterRefCol2`     | string                 | `"No Value"` | Second reference-table filter column. Use with `preFilterId2` when a second fixed condition is needed. |
| `colToUseAsFilter`  | string                 | `"No Value"` | Column whose value is carried to dependent filters; defaults to `postValueCol`.                        |
| `preFilterId`       | string                 | `"No Value"` | Initial value for the first configured filter.                                                         |
| `preFilterId2`      | string                 | `"No Value"` | Initial value for the second configured filter.                                                        |
| `jsonPreFilter`     | string                 | `"No Value"` | Reference-table column to compare with a value from the current form JSON.                             |
| `jsonPreFilterName` | string                 | `"No Value"` | Key in the current form JSON that supplies the value used by `jsonPreFilter`.                          |
| `useCompId`         | boolean                | `false`      | Uses `compId` rather than `refTable` as the key when updating dependent component filters.             |
| `useViewSort`       | boolean                | `false`      | Preserves the downloaded reference order instead of alphabetically sorting the list.                   |
| `sortAsc`           | boolean                | `false`      | Sorts `customdropdown` dataset options in ascending label order when enabled.                          |

`filterTable` and `filterRefCol` can contain comma-separated pairs. All configured filter conditions must match for a reference row to remain available.

## Scans and devices

| Key                   | Type            | Default     | Use                                                                                   |
| --------------------- | --------------- | ----------- | ------------------------------------------------------------------------------------- |
| `barcodeTable`        | string          | `"Barcode"` | Table containing scan values for smart-scan lookup.                                   |
| `barcodeCol`          | string          | `"Barcode"` | Column in `barcodeTable` containing the scanned value.                                |
| `deviceIds`           | string or array | none        | Device profile IDs for this component. A string may contain comma-separated IDs.      |
| `deviceOperationName` | string          | `""`        | One or more named device operations, separated by commas, semicolons, or line breaks. |
| `deviceOperations`    | object or array | none        | Maps device IDs to the named operations that component should run.                    |

Use this preferred `deviceOperations` shape when a component targets more than one device:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "compType": "device",
  "deviceOperations": {
    "com.example.flow-meter": ["read-flow-meter"],
    "com.example.temperature-probe": ["read-temperature"]
  },
  "dispMessage": "Device readings"
}
```

The operation names must exist in the active Device Kit profiles. See [Named operations](/device-kit/transports-and-operations#named-operations) for the profile boundary.

## Events

`events` can attach one configured plugin to each supported component event: `onInitialize`, `onSuccess`, `onFailure`, `onClick`, or `onLongClick`.

Each event object uses:

| Key          | Type    | Default | Use                                                                 |
| ------------ | ------- | ------- | ------------------------------------------------------------------- |
| `type`       | string  | none    | Plugin mode. The accepted values are `init`, `input`, and `output`. |
| `plugin`     | string  | `""`    | Registered plugin name.                                             |
| `identifier` | string  | `""`    | Identifier passed to the registered plugin action.                  |
| `arguments`  | object  | none    | Named plugin arguments.                                             |
| `enabled`    | boolean | `false` | Enables the event action.                                           |

Example:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "events": {
    "onSuccess": {
      "type": "output",
      "plugin": "registered-plugin",
      "identifier": "after-save",
      "arguments": {
        "mode": "quiet"
      },
      "enabled": true
    }
  }
}
```

Only use plugin names and identifiers registered for your FarmTrace account. The public setup contract does not provide a universal plugin catalogue.

## Use the setup names

The setup parser expects names such as `compType`, `postTargetCol`, `refTable`, and `displayCol`. Do not replace them with local model aliases such as `type`, `postColumn`, `tableName`, or `columnName`.

The parser also resolves fields such as calculated value pairs, filter state, view context, and selected scan values at runtime. Those values are not configuration keys and are not included on this page.

## Continue

* [Function setup](/dsync/function-setup)
* [Form fields](/dsync/function-setup/form-fields)
* [Component types](/dsync/function-setup/component-types)
