Telephone Number¶
Use the Telephone Number Rule Type when a field should contain a phone number. The rule validates and normalizes the extracted value, optionally stripping noise, and can constrain matches using country code and network/prefix patterns.
When to use¶
- Phone, mobile, or contact number fields on invoices, applications, KYC, and forms.
- Workflows where numbers must meet country/prefix policies (e.g., ZA mobile ranges).
- Any scenario that requires clean, consistently formatted numbers for dialing or CRM.
Open Field Configuration¶
See Field Rules (Rules Engine) for how to open the field configuration:
- From the document overlay (supported services), or
- From the Fields panel on the right sidebar.
Configure the TelephoneNo rule¶
Core settings:
- Rule Type: TelephoneNo
- Default Value: The value to return when nothing is extracted (e.g., Empty Text).
- Remove Invalid Characters: Remove unrelated characters from the extracted value (recommended).
Validation helpers (optional):
- Country Code Pattern: Provide a pattern to constrain allowable country codes (e.g., β+27β for South Africa).
- Network Pattern: Provide a pattern to constrain allowable network/operator prefixes or number shapes (e.g., mobile prefixes).
Patterns are your policy
Keep patterns simple and explicit. Use them to enforce the exact country and/or number ranges you accept. When in doubt, validate broadly and escalate edge cases rather than over-restricting.
Input parsing and normalization (if applicable)¶
Recommended normalization before/with validation:
- Trim whitespace.
- If Remove Invalid Characters is enabled, strip spaces, dashes, parentheses, and other non-number noise.
- Preserve a leading β+β when present (international format).
- Normalize common OCR artifacts cautiously (e.g.,
O
β0
,l
β1
) only when your data policy allows; otherwise, escalate.
Ambiguity handling:
- If multiple numbers are present (e.g., office + mobile), do not guess. Apply a selection policy (e.g., βfirst mobile-like matchβ) or escalate to review.
Extensions and shortcodes
If the value contains extensions (e.g., βx1234β, βext 1234β) or short codes, decide whether to: - Strip the extension and store it separately, or - Escalate for human confirmation. Avoid silently discarding potentially important digits.
Output and formatting (if applicable)¶
- Output the normalized number per your policy:
- International (recommended):
+<country><national>
(E.164-like). - National: keep leading zero and local formatting (only when your systems require it).
- International (recommended):
- If you enforce E.164, ensure the Country Code Pattern requires a leading β+β and valid country digits.
Downstream formatting
Store the canonical number (e.g., E.164) and render user-friendly formats (spaces, parentheses) in the UI or export layer.
Country Code Pattern and Network Pattern¶
These fields let you constrain acceptable numbers via simple, readable patterns.
-
Country Code Pattern (examples)
- Exact ZA:
^\+27
- US/Canada NANP:
^\+1
- ZA or US:
^\+(27|1)
- National-only (discourage):
^0
(accepts numbers starting with 0) β use with care.
- Exact ZA:
-
Network Pattern (examples)
- ZA mobile prefixes (082β084, 060β079, 061, 071, 072, etc.)
Example (simplified):^(6[0-9]|7[1-9]|8[1-4])
- US NANP 10-digit (area code + exchange not starting with 0/1):
^[2-9]\d{2}[2-9]\d{6}$
(when country code already handled) - Custom office pattern:
^[1-9]\d{6}$
(7-digit internal numbers)
- ZA mobile prefixes (082β084, 060β079, 061, 071, 072, etc.)
Notes:
- Apply Country Code Pattern to the full, leading portion of the number.
- Apply Network Pattern to the portion after the country code (or to the national portion if you store national format).
- Keep patterns aligned to the final stored representation (international vs national).
Order of operations
1) Normalize and optionally strip non-digit characters (preserve leading β+β).
2) Validate Country Code Pattern (if provided).
3) Remove the country code portion and validate Network Pattern against the remaining national digits.
HITL triggers and reviewer guidance¶
Trigger review when:
- The value doesnβt satisfy Country Code Pattern or Network Pattern.
- The number is too short/long for your policy (e.g., not 11β15 digits for international).
- Multiple different numbers are present with no deterministic selection policy.
- OCR ambiguity is suspected (e.g., letter/digit confusion) and you choose not to auto-correct.
Suggested reviewer note (HITL)
βVerify the telephone number. Ensure the correct country code and prefix are present and remove formatting characters. Expected output: a single, valid number (preferably international format, e.g., +27XXXXXXXXX).β
Examples¶
-
Normalize ZA mobile to international
- Input: β(082) 123β4567β
- Remove Invalid Characters: On β β0821234567β
- Country Code Pattern:
^\+27
(stored format requires +27) - Policy: Convert
0
national prefix to+27
Output:+27821234567
-
Enforce NANP (US/CA) with 10-digit national
- Input: β+1 (415) 555β2671β
- Country Code Pattern:
^\+1
- Network Pattern:
^[2-9]\d{2}[2-9]\d{6}$
(applied to4155552671
)
Output:+14155552671
-
Multiple numbers found (requires policy)
- Input: βTel: 021 555 1234, Mobile: 072 345 6789β
- Policy: Prefer mobile-like prefixes β select
072 345 6789
Output (ZA intβl):+27723456789
If no policy: escalate to HITL.
-
Ambiguous OCR
- Input: βO82 123 4S67β
- If no auto-correction policy: escalate to HITL with note to confirm O/0 and 5/S.
Best practices¶
- Choose one canonical storage format (prefer E.164-like) and stick to it.
- Use Country Code Pattern to prevent crossβcountry misclassification.
- Keep Network Pattern simple; revisit as carriers change prefixes.
- Donβt silently drop extensions; store separately or escalate.
- Log validation failures (which pattern failed, length mismatch) to speed reviews.
Testing checklist¶
- [ ] International vs national inputs (with/without β+β).
- [ ] Variety of formatting: spaces, dashes, parentheses.
- [ ] Country Code Pattern acceptance/rejection (positive and negative cases).
- [ ] Network Pattern acceptance/rejection across allowed prefixes.
- [ ] Multiple-number strings with your selection policy.
- [ ] OCR confusion cases (Oβ0, I/lβ1) and chosen handling (auto-correct vs HITL).
Troubleshooting¶
-
Number passes patterns but wonβt dial correctly
- Confirm youβre storing international format; ensure any national leading
0
is handled per country rules.
- Confirm youβre storing international format; ensure any national leading
-
Too many false rejections
- Relax Network Pattern or broaden accepted prefixes; verify youβre applying it to the correct portion (post-country code).
-
Numbers frequently missing the plus sign
- Add a pre-processing step to convert national numbers to international using the known country context.
-
Extensions pollute the number
- Extract extensions into a separate field (regex), then validate the remaining core number.
UI reference¶
- Base panel (Rule Type, Default Value, Remove Invalid Characters, Country Code Pattern, Network Pattern)