# TXTextControl.IfField Object

> Represents an MS Word specific IFFIELD field. Is used as a parameter for the addMergeField method.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Object
- **Introduced:** 25.0
- **Path:** DS Server > Reference > JavaScript API > TXTextControl.IfField Object
- **548 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol-iffield/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol-iffield/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol-iffield/llms-full.txt

---

### Description

Represents an MS Word specific IFFIELD field. Is used as a parameter for the [addMergeField](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/addmergefield-method/llms-full.txt) method.

### Syntax

```javascript
TXTextControl.IfField
```

### Examples

The following example demonstrates `TXTextControl.IfField` in a practical document-editing workflow. It represents an MS Word specific IFFIELD field. Is used as a parameter for the addMergeField method.

```javascript
function inspectIfField(ifField) {
    console.log("TXTextControl.IfField object:", ifField);
}
```

---

## In This Section

- [Javascript: TXTextControl.IfField.expression1 Property](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol-iffield/expression1-property/llms-full.txt): Specifies the first expression text that should be compared. This property must be a valid field name.
- [Javascript: TXTextControl.IfField.expression2 Property](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol-iffield/expression2-property/llms-full.txt): Specifies the second expression text that should be compared to Expression1.
- [Javascript: TXTextControl.IfField.falseText Property](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol-iffield/falsetext-property/llms-full.txt): Specifies the text that should be displayed when the comparison is false.
- [Javascript: TXTextControl.IfField.operator Property](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol-iffield/operator-property/llms-full.txt): Specifies the comparison operator. Possible values are defined in TXTextControl.RelationalOperator.
- [Javascript: TXTextControl.IfField.preserveFormatting Property](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol-iffield/preserveformatting-property/llms-full.txt): Specifies whether the field's formatting should be preserved.
- [Javascript: TXTextControl.IfField.text Property](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol-iffield/text-property/llms-full.txt): Specifies the initial text of the field. Let this property be null to use the default text "IF".
- [Javascript: TXTextControl.IfField.trueText Property](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol-iffield/truetext-property/llms-full.txt): Specifies the text that should be displayed when the comparison is true.

---

## Nearby

- **Previous:** [Javascript: TXTextControl.HtmlDialogBoxKind Enumeration](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/htmldialogboxkind-enumeration/llms-full.txt)
- **Next:** [Javascript: TXTextControl.IfField.expression1 Property](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol-iffield/expression1-property/llms-full.txt)
