Developer Function: Server Script: columns.AddChoiceHash
## Overview
This is the "AddChoiceHash method" of the "columns object". The "[Server Script](/en/manual/table-management-server-script)" can dynamically set the "[Option List](/en/manual/table-management-choices-text)" of "[Class Column](/en/manual/table-management-class)" by calling AddChoiceHash multiple times. When AddChoiceHash is called the first time, all choices set before the execution of the "[Server Script](/en/manual/table-management-server-script)" are cleared.
## Supported Versions
1. Pleasanter 1.2.4.0 or later
1. Pleasanter .NET Framework version 0.50.267.0 or later
## Limitations
1. Only "[Class Column](/en/manual/table-management-class)" can be used.
## Prerequisites
1. At least one option must be set in the option list for the target column.
1. This is valid when the server script "「Condition」" is "Before opening the page" or "Before opening the row".
## Syntax
```
columns.[Column Name].AddChoiceHash(key, value);
```
## Parameter
If the parameter value is omitted, it will be interpreted as AddChoiceHash(key, key).
|No|Parameter|Type|Required|Overview|
|:--|:----------|:----------|:---:|:---------------------------|
|1|key|object|Yes|Key|
|2|value|object| - |Value|
## Return Value
There is no return value.
## Usage Example
In the example below, a "Option list" from TEST1 to TEST5 is set for ClassA.
### When value is specified
##### JavaScript
```js
for (let i = 1; i <= 5; i++) {
columns.ClassA.AddChoiceHash(i, 'TEST' + i);
}
```
In this case, you will get the same display result as when specifying the [Option List](/en/manual/table-management-choices-text) of the [Class Column](/en/manual/table-management-class) as follows:

### When value is omitted
##### JavaScript
```js
for (let i = 1; i <= 5; i++) {
columns.ClassA.AddChoiceHash('TEST' + i);
}
```
In this case, you will get the same display result as when specifying the [Option List](/en/manual/table-management-choices-text) of the [Class Column](/en/manual/table-management-class) as follows:

## Supported Versions
|Supported Version|Details|
|:--|:--|
|1.2.4.0 and later|Feature added|
|1.4.23.0 and later|Parameter value can be omitted|
## Related Information
<div id="ManualList"><ul><li><a href="/en/manual/table-management-class">Manage Table: Items: Class</a><span>12.09.2025 up</span></li></ul></article>
<ul><li><a href="/en/manual/table-management-choices-text">Manage Table: Editor: Column Advanced Settings: Option List</a><span>11.27.2025 up</span></li></ul></article>
<ul><li><a href="/en/manual/table-management-server-script">Table Management: Server Script</a><span>08.13.2024 up</span></li></ul></article></div><input id="SearchTextHidden" type="hidden" value="" />