Struct FieldValue
Represents the strongly-typed value of a field recognized from the input document and provides methods for converting it to the appropriate type.
Namespace: System.Dynamic.ExpandoObject
Assembly: Azure.AI.FormRecognizer.dll
Syntax
public struct FieldValue
Properties
ValueType
The data type of the field value.
Declaration
public Azure.AI.FormRecognizer.Models.FieldValueType ValueType { get; }
Property Value
FieldValueType
|
Methods
AsCountryRegion()
Gets the value of the field as an ISO 3166-1 alpha-3 country code System.String.
Declaration
public string AsCountryRegion ();
Returns
System.String
The value of the field converted to an ISO 3166-1 alpha-3 country code System.String. |
Exceptions
System.InvalidOperationException
Thrown when ValueType is not CountryRegion. |
AsDate()
Gets the value of the field as a System.DateTime.
Declaration
public DateTime AsDate ();
Returns
System.DateTime
The value of the field converted to a System.DateTime. |
Exceptions
System.InvalidOperationException
Thrown when ValueType is not Date or when the value is |
AsDictionary()
Gets the value of the field as a System.Collections.Generic.Dictionary`2.
Declaration
public System.Collections.Generic.IReadOnlyDictionary<string,Azure.AI.FormRecognizer.Models.FormField> AsDictionary ();
Returns
System.Collections.Generic.IReadOnlyDictionary<System.String,FormField>
The value of the field converted to a System.Collections.Generic.Dictionary`2. |
Exceptions
System.InvalidOperationException
Thrown when ValueType is not Dictionary. |
AsFloat()
Gets the value of the field as a System.Single.
Declaration
public float AsFloat ();
Returns
System.Single
The value of the field converted to a System.Single. |
Exceptions
System.InvalidOperationException |
AsInt64()
Gets the value of the field as a System.Int64.
Declaration
public long AsInt64 ();
Returns
System.Int64
The value of the field converted to a System.Int64. |
Exceptions
System.InvalidOperationException
Thrown when ValueType is not Int64 or when the value is |
AsList()
Gets the value of the field as an System.Collections.Generic.IReadOnlyList.
Declaration
public System.Collections.Generic.IReadOnlyList<Azure.AI.FormRecognizer.Models.FormField> AsList ();
Returns
System.Collections.Generic.IReadOnlyList<FormField>
The value of the field converted to an System.Collections.Generic.IReadOnlyList. |
Exceptions
System.InvalidOperationException |
AsPhoneNumber()
Gets the value of the field as a phone number System.String.
Declaration
public string AsPhoneNumber ();
Returns
System.String
The value of the field converted to a phone number System.String. |
Exceptions
System.InvalidOperationException
Thrown when ValueType is not PhoneNumber. |
AsSelectionMarkState()
Gets the value of the field as a SelectionMarkState.
Declaration
public Azure.AI.FormRecognizer.Models.SelectionMarkState AsSelectionMarkState ();
Returns
SelectionMarkState
The value of the field converted to SelectionMarkState. |
Remarks
This method is only available for V2_1 and up.
Exceptions
System.InvalidOperationException
Thrown when ValueType is not SelectionMark. |
AsString()
Gets the value of the field as a System.String.
Declaration
public string AsString ();
Returns
System.String
The value of the field converted to a System.String. |
Exceptions
System.InvalidOperationException |