Field types for Document Processing

You can define the following field types that are provided with IBM Automation Document Processing.

Basic field types

Basic field types are default field types, which you can validate by using regular expressions (regex). The basic types have a well-defined format for the output.

Table 1. Basic field types
Field type Description
Boolean A field that can have a value that is either true or false. Valid values are true/True and false/False.
Date

YYYY-MM-DD format. The details of the format are as follows:

date-fullyear "-" date-month "-" date-mday
  • date-fullyear = 4DIGIT
  • date-month = 2DIGIT ; 01-12
  • date-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31

This format is based on the standard RFC 3339.

For example: 2020-11-30.

Regex (this expression does not check for leap year):
\d{4}-(02-(0[1-9]|[12]\d)|(0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01])|(0[469]|11)-(0[1-9]|[12][0-9]|30))
Decimal

A number with an integer value, a decimal point, and a fractional value. A decimal can begin with a minus sign for a negative number.

A decimal number is represented in base 10 using decimal digits. It contains an integer component that might be prefixed with an optional minus sign, which might be followed by a fractional part.

A fraction part is a decimal point that is followed by one or more digits.

"-" integer fractional part.

For example:
-123, -123.4, 123, 123.4
Regex:
\-?(?=\D*\d)(\d*\.)?\d+$
Numeric Unsigned numeric integer Regex.
Regex:
[0-9]+
String A text string.

Field types defined in a pre-trained system

Table 2. Pre-Trained field types and subfields
Field name Type Simple / Composite Standard Data Definition Formatter Validator Converter Composite Parent Field Name Description
Address block String Simple No None None None N/A A postal address that is a multi-line block of text.
Address information Object Composite No None Regex None N/A An object type that is used to store the named entity and postal mail address that are parsed from a mail address block. Includes an email, name, organization, phone, and postal mail address.

You must use one of the default extractors, Postal mail address extractor or Additional address information extractor, to be able to parse the subfields information.

Email String Simple No None Regex None Address information Email address, in the form of localpart@domainname.aaa.
Name String Simple No None Regex None Address information The name of a person, including first, middle, or last name.
Organization String Simple No None Regex None Address information The name of an organization, such as a company, an institution, or an association.
Phone String Simple No None Regex None Address information A phone number.
Addressee String Simple No None None None N/A Person name in a postal address such as a person, company, or organization.
Country code String Simple No None Dictionary Dictionary List of country names converted to three-digit alpha code N/A Country Alpha 3 codes as defined in ISO 3166-1 External link opens a new window or tab countries.
Country name String Simple No None Dictionary Name of a country using English short name None N/A Name of a country that uses an English short name as defined in the ISO 3166-1 External link opens a new window or tab standard.
Currency Object Composite No None None None N/A  
Currency amount Decimal Simple No None None Convert to decimal Currency Currency symbol or three-digit code before or after a decimal number with 1000's separators and decimal separator. This is locale-specific.
Currency code String Simple No None Dictionary Convert to Currency code Currency Three-letter currency code, as defined in the ISO 4217 standard.

For more information, see https://en.wikipedia.org/wiki/ISO_4217 External link opens a new window or tab

Date range Object Composite No None None None N/A A range between two dates, marked by a start date and an end date, for example a bill period.
Decimal range Object Composite No None None None N/A A range between two decimals.
Email address String Simple Yes None Regex None N/A Email address, in the form of localpart@domainname.aaa. This is case-insensitive.
Validated against basic email format by using regex:
[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}
First name String Simple No None None None N/A First word in a name field. Single word or character - can be in initial or a name.
Full name String Simple Yes None None None N/A Full name of a person that is not separated into individual fields for each part of the name.
Last name String Simple No None None None N/A One or more words that are separated with a space - can be multiple names and suffix (Jr, Sr, Esq...).
Middle name String Simple No None None None N/A One or more words or characters can be initials or multiple names.
Numeric range Object Composite No None None None N/A A range between two numbers.
Percentage Decimal Simple No None Range 0-100 Convert to decimal N/A Input as decimal or with percentage symbol.

Input 50.5% or .505 or 0.505

Convert to .505

Validated by using regex:
(0*100{1,1}\.?((?<=\.)0*)?%?$)|(^0*\d{0,2}\.?((?<=\.)\d*)?%?)
Percentage range Object Composite No None None None N/A A range between two percentages.
Phone number String Simple Yes None Regex US None N/A

US Phone Number.

Validated by using regex:
[+]?[1\s-]*[\(-]?[0-9]{3}[-\)]?[\s-]?[0-9]{3}[\s-]?[0-9]{4}
Postal mail address Object Composite No None Regex None Address information An object type that is used to store postal mail address information in the United States, the United Kingdom, Canada and Australia. Includes a building number, city, country, entrance, full address block, level, PO box, postal code, state or province, street name, and unit.

You must use one of the default extractors, Postal mail address extractor or Additional address information extractor, to be able to parse the subfields information.

Building number String Simple No None Regex None Postal mail address Building number from an address block.
City String Simple No None Regex None Postal mail address City name from an address block.
Country String Simple No None Regex None Postal mail address Country codes as defined in ISO 3166-1 External link opens a new window or tab countries.
Entrance String Simple No None Regex None Postal mail address Numbered or lettered entrance of a building from an address block.
Full address block String Simple No None Regex None Postal mail address All information from an address block.
Level String Simple No None Regex None Postal mail address Indicates a floor number such as "3rd Floor" or "Ground Floor".
PO box String Simple No None Regex None Postal mail address Post office box, typically found in non-physical (mail-only) addresses.
Postal code String Simple No None Regex None Postal mail address Postal codes that are used for sorting mail.
State or province String Simple No None Regex None Postal mail address A first-level administrative division within a country.
Street name String Simple No None Regex None Postal mail address Street name from an address block.
Unit String Simple No None Regex None Postal mail address An apartment, unit, office, lot, or other secondary unit designator from an address block.
Social security number String Simple Yes None Regex None N/A US social security number.
Validated by using regex:
(?!000|666)[0-8][0-9]{2}-(?!00)[0-9]{2}-(?!0000)[0-9]{4}
URL String Simple No None Regex None N/A Web address.
Validated by using regex:
http[s]?://(?:[a-zA-Z0-9$-_@.&+!*\(\),]|(?:%[0-9a-zA-Z]))+
US mail address Object Composite Yes None None None N/A Postal address in the US or Canada. Includes an address line, city, state/province, and postal code.
Address line String Simple No None None None US Mail Address Street address, PO Box.
City name String Simple No None None None US Mail Address For a postal address composite.
US state String Simple No None Dictionary Dictionary List of state names converted to abbreviations US Mail Address US states. Input includes state name or abbreviation that is converted to a two-digit code.

For more information about the US state names and codes, see the Wikipedia page List of U.S. state and territory abbreviations External link opens a new window or tab.

ZIP code String Simple No None Regex None US Mail Address US ZIP code. Either 5 or 9 digits in one of the following forms:
  • NNNNN
  • NNNNN-NNNN
  • NNNNNNNNN
Validated by using Regex:
\d{5}(?:-?\d{4})?