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")

See Also