# FilterInstruction Class

> The FilterInstruction class is used to filter merge block data by certain conditions before merging. A filter instruction represents a condition which must be fulfilled by the content of a data row in a data table to execute a certain merge action. It uses a relational operator such as "is equal to" or "is greater than" to compare a given value to the contents of a specified data row column. This class is used in class MergeBlockInfo to determine if a merge block should be merged at all, for example. Multiple filter instructions can be logically concatenated using "and" and "or" operators.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Class
- **Introduced:** 26.0
- **Namespace:** `TXTextControl.DocumentServer.DataShaping`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXDocumentServer.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXDocumentServer.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl.DocumentServer.DataShaping > FilterInstruction Class
- **1006 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datashaping/filterinstruction/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datashaping/filterinstruction/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datashaping/filterinstruction/llms-full.txt

---

### Description

The FilterInstruction class is used to filter merge block data by certain conditions before merging. A filter instruction represents a condition which must be fulfilled by the content of a data row in a data table to execute a certain merge action. It uses a relational operator such as "is equal to" or "is greater than" to compare a given value to the contents of a specified data row column. This class is used in class [MergeBlockInfo](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datasources/mergeblockinfo/llms-full.txt) to determine if a merge block should be merged at all, for example. Multiple filter instructions can be logically concatenated using "and" and "or" operators.

### Syntax

```csharp
public class FilterInstruction
```

```vbnet
Public Class FilterInstruction
```

### Examples

The following example creates a Filter Instruction instance and configures its column name setting for a document workflow.

```csharp
TXTextControl.DocumentServer.DataShaping.FilterInstruction filterInstruction = new("CustomerName", TXTextControl.DocumentServer.DataShaping.RelationalOperator.Equals);
filterInstruction.ColumnName = "CustomerName";
```

```vbnet
Dim filterInstruction As New TXTextControl.DocumentServer.DataShaping.FilterInstruction("CustomerName", TXTextControl.DocumentServer.DataShaping.RelationalOperator.Equals)
filterInstruction.ColumnName = "CustomerName"
```

---

## In This Section

- [FilterInstruction.ColumnName Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datashaping/filterinstruction/columnname-property/llms-full.txt): Gets or sets the name of the table column whose content this merge condition is compared to.
- [FilterInstruction.CompareTo Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datashaping/filterinstruction/compareto-property/llms-full.txt): Gets or sets the value the table column content is compared to using the specified comparison operator. If this value can be parsed to a numerical value, a numerical comparison is used internally when possible (i. e. when the table column contains numerical values, too). Otherwise the column content and this value are interpreted as / converted to strings.
- [FilterInstruction.ComparisonOperator Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datashaping/filterinstruction/comparisonoperator-property/llms-full.txt): Gets or sets the relational operator used as the comparison operator. See the description of the constructor of this class for possible values.
- [FilterInstruction Constructor](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datashaping/filterinstruction/constructor/llms-full.txt): Initializes a new instance of the FilterInstruction class.
- [FilterInstruction.Culture Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datashaping/filterinstruction/culture-property/llms-full.txt): Gets or sets the format provider for numerical value comparison. The default value for this property is the invariant culture.
- [FilterInstruction.LogicalOperator Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datashaping/filterinstruction/logicaloperator-property/llms-full.txt): Gets or sets the logical operator by which to logically connect a filter instruction to the previous one if a filter consists of a collection of multiple filter instructions. Possible values are listed in the description of the constructor of this class.

---

## Nearby

- **Previous:** [TXTextControl.DocumentServer.DataShaping namespace](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datashaping/llms-full.txt)
- **Next:** [FilterInstruction.ColumnName Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-documentserver-datashaping/filterinstruction/columnname-property/llms-full.txt)
