get_fields_by_name method

get_fields_by_name

Returns the collection of field data where the name is equal to field_name.

def get_fields_by_name(self, field_name):
    ...
Parameter Type Description
field_name str The name of the field.

Returns: list[FieldData]: A collection of FieldData objects; empty collection if no field data is found.

Example

# Find fields by a field name
fields = data.get_fields_by_name("InvoiceNumber")
if fields:
    print(f"Found {len(fields)} field(s) named 'InvoiceNumber'")
    for field in fields:
        print(field.text)
else:
    print("InvoiceNumber not found")

Aliases

These names call get_fields_by_name too, limited to the overloads listed.

Alias Accepts
get_fields_by_name_file get_fields_by_name_file(field_name)
get_fields_by_name_string get_fields_by_name_string(field_name)

See Also