# ConditionalInstructionCollection.GetItems Method

> Gets those ConditionalInstruction elements from the collection, where at least one Condition or Instruction element references the specified FormField.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WPF.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 WPF > Reference > TXTextControl > ConditionalInstructionCollection.GetItems Method
- **603 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/conditionalinstructioncollection/getitems-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/conditionalinstructioncollection/getitems-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/conditionalinstructioncollection/getitems-method/llms-full.txt

---

### Description

Gets those [ConditionalInstruction](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/conditionalinstruction/llms-full.txt) elements from the collection, where at least one [Condition](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/condition/llms-full.txt) or [Instruction](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/instruction/llms-full.txt) element references the specified [FormField](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/formfield/llms-full.txt).

### Syntax

```csharp
public ConditionalInstruction[] GetItems(FormField formField);
```

```vbnet
Public Function GetItems(formField As FormField) As ConditionalInstruction()
```

### Parameters

| Parameter | Description |
|---|---|
| formField | Specifies the `FormField` that is referenced inside the requested `ConditionalInstruction` elements. |

### Return Value

The return value is null, if the [TextControl.IsFormFieldValidationEnabled](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/isformfieldvalidationenabled-property/llms-full.txt) property is set to false. Otherwise an array of all `ConditionalInstruction` elements that references the specified `FormField` is returned.

### Examples

The following example retrieves items from the conditional instruction collection.

```csharp
ConditionalInstruction[] results = conditionalInstructionCollection.GetItems(new TXTextControl.CheckFormField(true));
foreach (ConditionalInstruction conditionalInstruction in results)
{
    Console.WriteLine(conditionalInstruction);
}
```

```vbnet
Dim results As ConditionalInstruction() = conditionalInstructionCollection.GetItems(New TXTextControl.CheckFormField(True))
For Each conditionalInstruction As ConditionalInstruction In results
    Console.WriteLine(conditionalInstruction)
Next
```

---

## Nearby

- **Previous:** [ConditionalInstructionCollection.GetItem Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/conditionalinstructioncollection/getitem-method/llms-full.txt)
- **Next:** [ConditionalInstructionCollection.IsValueValid Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/conditionalinstructioncollection/isvaluevalid-method/llms-full.txt)
