# Javascript: ApplicationField.getParameters Method

> Gets the field' parameters. The order and format of the strings depend on the field's format. For example a Microsoft Word MergeField has the following format: MERGEFIELD FieldName [switches]. In this case the first string of the array is the FieldName and the following strings are possible switches. The string MERGEFIELD is the type name of the field and can be obtained through getTypeName. If a field has no parameters, this array is null.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: ApplicationField.getParameters Method
- **596 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/applicationfield/getparameters-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/applicationfield/getparameters-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/applicationfield/getparameters-method/llms-full.txt

---

### Description

Gets the field' parameters. The order and format of the strings depend on the field's format. For example a Microsoft Word MergeField has the following format: MERGEFIELD FieldName \[switches\]. In this case the first string of the array is the FieldName and the following strings are possible switches. The string MERGEFIELD is the type name of the field and can be obtained through [getTypeName](https://docs.textcontrol.com/ds-server/reference/javascript/applicationfield/gettypename-method/llms-full.txt). If a field has no parameters, this array is null.

### Syntax

```javascript
<void> ApplicationField.getParameters(<RequestStringsCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the parameters as a string array. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `ApplicationField.getParameters` in a practical document-editing workflow. It gets the field' parameters. The order and format of the strings depend on the field's format. For example a Microsoft Word MergeField has the following format: MERGEFIELD FieldName \[switches\]. In this case the first string of the array is the FieldName and the following strings are possible switches. The string MERGEFIELD is the type name of the field and can be obtained through getTypeName. If a field has no parameters, this array is null.

```javascript
function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

TXTextControl.textParts.getMainText(function(mainText) {
    const applicationFields = mainText.applicationFields;
    applicationFields.getItem(function(applicationField) {
        if (!applicationField) {
            console.warn("No application field is available at the current input position.");
            return;
        }
    
        applicationField.getParameters(
            function(result) {
                console.log("get parameters result:", result);
            },
            onTxError
        );
    }, onTxError);
}, onTxError);
```

---

## Nearby

- **Previous:** [Javascript: ApplicationField.getFormat Method](https://docs.textcontrol.com/ds-server/reference/javascript/applicationfield/getformat-method/llms-full.txt)
- **Next:** [Javascript: ApplicationField.getTypeName Method](https://docs.textcontrol.com/ds-server/reference/javascript/applicationfield/gettypename-method/llms-full.txt)
