# ConditionalInstructionCollection.GetItem Method

> Gets that ConditionalInstruction element from the collection, where the Name property value equals the specified name.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl > ConditionalInstructionCollection.GetItem Method
- **487 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/conditionalinstructioncollection/getitem-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/conditionalinstructioncollection/getitem-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/conditionalinstructioncollection/getitem-method/llms-full.txt

---

### Description

Gets that [ConditionalInstruction](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/conditionalinstruction/llms-full.txt) element from the collection, where the [Name](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/conditionalinstruction/name-property/llms-full.txt) property value equals the specified name.

### Syntax

```csharp
public ConditionalInstruction GetItem(string name);
```

```vbnet
Public Function GetItem(name As String) As ConditionalInstruction
```

### Parameters

| Parameter | Description |
|---|---|
| name | Specifies the name of the requested `ConditionalInstruction` element. |

### Return Value

The return value is null, if the [TextControl.IsFormFieldValidationEnabled](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/isformfieldvalidationenabled-property/llms-full.txt) property is set to false or the collection does contain a `ConditionalInstruction` element with the specified name. Otherwise, the return value is an object of the type ConditionalInstruction with the specified name.

### Examples

The following example retrieves item from the conditional instruction collection.

```csharp
var result = conditionalInstructionCollection.GetItem("CustomerName");
Console.WriteLine($"Get Item result: {result}");
```

```vbnet
Dim result = conditionalInstructionCollection.GetItem("CustomerName")
Console.WriteLine($"Get Item result: {result}")
```

---

## Nearby

- **Previous:** [ConditionalInstructionCollection.GetEnumerator Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/conditionalinstructioncollection/getenumerator-method/llms-full.txt)
- **Next:** [ConditionalInstructionCollection.GetItems Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/conditionalinstructioncollection/getitems-method/llms-full.txt)
