# IOpcDataFieldInfo Members

> Reference: Defines the metadata of a field declared by a data type.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">IOpcDataFieldInfo</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx">Opc.UaFx</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
<dt>Also in</dt>
<dd>Opc.UaFx.Client</dd>
</dl>

## Properties

### DeclaringType

Gets the type that declares the current [IOpcDataFieldInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatafieldinfo/).

<div class="api-signature" data-lang="csharp">

```csharp
IOpcDataTypeInfo DeclaringType { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
ReadOnly Property DeclaringType As IOpcDataTypeInfo
```

</div>

**Property value**

[IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/)

The [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/) which declares the current [IOpcDataFieldInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatafieldinfo/).

### FieldType

Gets the type of value this field provides.

<div class="api-signature" data-lang="csharp">

```csharp
IOpcDataTypeInfo FieldType { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
ReadOnly Property FieldType As IOpcDataTypeInfo
```

</div>

**Property value**

[IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/)

The [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/) representing the type of value this field provides.

### IsOptional

Gets a value indicating whether the current field might not necessarily exist in the object defined by the [DeclaringType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatafieldinfo/members#declaringtype).

<div class="api-signature" data-lang="csharp">

```csharp
bool IsOptional { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
ReadOnly Property IsOptional As Boolean
```

</div>

**Property value**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if the field might not always exists; otherwise the value false. Additionally see the [Switch](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatafieldinfo/members#switch) property.

### Length

Gets the length of the field expressed either explicit or implicit using a different [IOpcDataFieldInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatafieldinfo/).

<div class="api-signature" data-lang="csharp">

```csharp
OpcMemberLength Length { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
ReadOnly Property Length As OpcMemberLength
```

</div>

**Property value**

[OpcMemberLength](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmemberlength/)

An instance of the [OpcMemberLength](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmemberlength/) class with the explicit length of the field or the reference to the [IOpcDataFieldInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatafieldinfo/) its value expresses the length of the current [IOpcDataFieldInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatafieldinfo/).

### Name

Gets the name of the current [IOpcDataFieldInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatafieldinfo/).

<div class="api-signature" data-lang="csharp">

```csharp
string Name { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
ReadOnly Property Name As String
```

</div>

**Property value**

[String](https://learn.microsoft.com/dotnet/api/system.string)

A [string](https://learn.microsoft.com/dotnet/api/system.string) containing the name of this field.

### ReflectedType

Gets the type that was used to obtain this instance of [IOpcDataFieldInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatafieldinfo/).

<div class="api-signature" data-lang="csharp">

```csharp
IOpcDataTypeInfo ReflectedType { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
ReadOnly Property ReflectedType As IOpcDataTypeInfo
```

</div>

**Property value**

[IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/)

An [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/) object used to obtain this instance.

### Switch

Gets the switch condition which applies to the current [IOpcDataFieldInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatafieldinfo/).

<div class="api-signature" data-lang="csharp">

```csharp
OpcMemberSwitch Switch { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
ReadOnly Property Switch As OpcMemberSwitch
```

</div>

**Property value**

[OpcMemberSwitch](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmemberswitch/)

An instance of the [OpcMemberSwitch](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmemberswitch/) class which defines the conditions to fulfill so that the current [IOpcDataFieldInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatafieldinfo/) exists in an instance.

## Methods

### GetValue

Gets the value of the field supported by the given object `instance`.

<div class="api-signature" data-lang="csharp">

```csharp
object GetValue(object instance)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Function GetValue(instance As Object) As Object
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `instance` | [Object](https://learn.microsoft.com/dotnet/api/system.object) | The [object](https://learn.microsoft.com/dotnet/api/system.object) whose field value will be returned. |

**Returns**

[Object](https://learn.microsoft.com/dotnet/api/system.object)

An object containing the value of the field reflected by this instance.

### SetValue

Sets the value of the field supported by the given object `instance`.

<div class="api-signature" data-lang="csharp">

```csharp
void SetValue(object instance, object value)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Sub SetValue(instance As Object, value As Object)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `instance` | [Object](https://learn.microsoft.com/dotnet/api/system.object) | The [object](https://learn.microsoft.com/dotnet/api/system.object) whose field value will be set. |
| `value` | [Object](https://learn.microsoft.com/dotnet/api/system.object) | The value to assign to the field. |
