DocumentDataGetFieldsByName Method
Returns the collection of field data where the name is equal to fieldName.

Namespace: GroupDocs.Parser.Data
Assembly: GroupDocs.Parser (in GroupDocs.Parser.dll) Version: 21.5.0
public IList<FieldData> GetFieldsByName(
	string fieldName


Type: SystemString
The name of the field.

Return Value

Type: IListFieldData
A collection of FieldData objects; empty collection if no field data is found.

Find fields by a field name:

// Get all the fields with "Address" name
IList<FieldData> addressFields = data.GetFieldsByName("Address");
if(addressFields.Count == 0) {
    Console.WriteLine("Address not found");
else {
    // Iterate over the fields collection
    for (int i = 0; i < addressFields.Count; i++) {
        PageTextArea area = addressFields[i].PageArea as PageTextArea;
        Console.WriteLine(area == null ? "Not a template field" : area.Text);       

        // If it's a related field:
        if(addressFields[i].LinkedField != null) {
            Console.Write("Linked to ");
            PageTextArea linkedArea = addressFields[i].LinkedField.PageArea as PageTextArea;
            Console.WriteLine(area == null ? "Not a template field" : area.Text);           

FieldData class represents field data. Depending on the field PageArea property can contain any of the inheritors of PageArea class. For example, ParseForm method extracts only text fields.

See Also