Pseudoconstant settings tells the code how to determine the valid options for the field value and must be specified by using *one* of the following *three* methodologies:
### Using the `civicrm_option_value` table
With this methodology, the acceptable field values are taken from rows in the `civicrm_option_value` for a given *option group*.
Tags acceptable within `<table>` / `<field>` / `<pseudoconstant>`
| Tag | Contains | Example | Acceptable<br>Instances | Purpose |
| -- | -- | -- | -- | -- |
| `<optionGroupName>` | text | `campaign_type` | 1 | The option group name from `civicrm_option_group.name` |
### Using an arbitrary table
With this methodology, the acceptable field values are taken from `<keyColumn>` in `<table>`, with some extra settings that make it different from your typical foreign key.
Tags acceptable within `<table>` / `<field>` / `<pseudoconstant>`
| Tag | Contains | Example | Acceptable<br>Instances | Purpose |
| -- | -- | -- | -- | -- |
| `<table>` | text | `civicrm_campaign` | 1 | The name of the referenced table containing the values |
| `<keyColumn>` | text | `id` | 1 | The column in the referenced table which contains values that match *this* field |
| `<labelColumn>` | text | `full_name` | 1 | The column in the referenced table which contains a human-readable variant of the value |
| `<nameColumn>` | text | `iso_code` | 0 or 1 | Optionally, the column in the referenced table which contains a machine-readable name of the value. |
| `<condition>` | SQL | `parent_id IS NULL` | 0 or 1 | Extra SQL to add in a `WHERE` clause that will further limit the possible options |
!!! note "`<nameColumn>`"
In some cases, `<keyColumn>` will reference a column containing integers and `<nameColumn>` will reference a column containing values like `"Individual"`. Setting `<nameColumn>` in these cases allows us to use specify `"Individual"` when making API calls.
### Using a callback function
With this methodology, the acceptable field values are taken from a PHP callback function.
Tags acceptable within `<table>` / `<field>` / `<pseudoconstant>`
| Tag | Contains | Example | Acceptable<br>Instances | Purpose |
| -- | -- | -- | -- | -- |
| `<table>` | text | `civicrm_campaign` | 0 or 1 | *Not yet documented* |
| `<optionGroupName>` | text | `campaign_type` | 0 or 1 | *Not yet documented* |
| `<keyColumn>` | text | `id` | 0 or 1 | *Not yet documented* |
| `<labelColumn>` | text | `full_name` | 0 or 1 | *Not yet documented* |
| `<nameColumn>` | text | `iso_code` | 0 or 1 | *Not yet documented* |
| `<condition>` | SQL | `parent_id IS NULL` | 0 or 1 | *Not yet documented* |
| `<callback>` | function reference | `CRM_Core_SelectValues::eventDate` | 0 or 1 | *Not yet documented* |
| `<callback>` | text | `CRM_Core_SelectValues::eventDate` | 1 | Static reference to a function in the codebase |