Phone cleanser
Learn how the phone cleanser validates and standardizes global phone numbers.
Cleanser Name - PhoneCleanserFn
Description
The Phone Cleanser (PhoneCleanserFn) validates, standardizes, and enriches phone numbers as part of data cleansing in the Reltio Data Cloud. It uses Google's libphonenumber library to enforce country‑specific rules and produce a consistent set of output attributes.
Phone numbers are often inconsistent or poorly formatted — entered in inconsistent formats, missing country codes, or containing formatting characters. The Phone Cleanser ensures:
- Data is consistent and standardized across systems
- Phone attributes are validated and normalized
- Downstream processes (matching, analytics, communication) work with high‑quality phone data. This enables reliable identity resolution and better data integrity across domains.Important: Cleansing does not guarantee that a phone number is in service or reachable. It verifies format, structure, length, and consistency of the phone number based on numbering plans.The cleanser validates numbers against country‑specific rules, applies format rules, length checks, and structure rules and detects/assigns valid number type and metadata.
Supported phone number formats
| Input Type | Example |
|---|---|
| With country code | +1 415 555 2671 |
| Without country code | 4155552671 (US by default or based on config) |
| With formatting characters | (415) 555‑2671, 415.555.2671 |
| Vanity number | 1‑800‑FLOWERS (converted to digits) |
| Condition | Behavior |
|---|---|
| Valid country code provided | Uses rules for that country |
| Missing or invalid country code | Defaults to US. When no country code is supplied, the cleanser assumes US formatting and validation rules. This may produce unexpected or invalid results for international numbers. We recommend supplying a valid ISO country code or an E.164 formatted number to ensure accurate validation and formatting. |
| No code, but + prefix detected | Attempts auto-detection from number format |
| Format | Notes |
|---|---|
+1 (415) 555-2671 | Valid US number |
4155552671 | Valid (auto-detected US) |
+44 20 7946 0958 | Valid UK number |
+33 1 42 86 83 26 | Valid French number |
Examples of invalid formats
| Format | Reason |
|---|---|
1234567890 | Too short for most countries |
+1 555 000 0000 | Invalid area code (555 is reserved) |
+1 415 555 | Too short (missing digits) |
Output formats and extracted fields
After cleansing, the phone attribute is enriched with the following structured results:
| Output name | Description | Example / Notes |
|---|---|---|
| Validation status | Indicates whether the number passed all validation checks | VALID, INVALID |
| Phone number format | E164: Phone number in international E.164 format | +14155552671 |
| National: Country-specific national format | (415) 555-2671 | |
| International: International format with spaces | +1 415 555 2671 | |
| RFC3966: URI-compatible phone format (RFC3966) | tel:+1-415-555-2671 | |
| Country Code | Country identifier used for validation (ISO or numeric) | US or 1 |
| Area code | Regional area code extracted from number | 415 |
| Local number | Local portion of the number, after area code | 5552671 |
| Extension | Extension provided in input (if any) | 123 |
| Line type | Classification of number type | MOBILE, FIXED_LINE, TOLL_FREE, VOIP |
| Geo country | Country derived from number's geography | United States |
| Geo area | State, province, or city (if regionally mappable) | California, London |
| Carrier information | Carrier associated with number, if available | AT&T |
| Format mask | Pattern showing digit structure of the number | +n (nnn) nnn-nnnn |
| Digit count | Number of numeric digits (excluding symbols or separators) | 11 |
| Digits number | Fully numeric version of the phone number | 14155552671 |
Cleanser configuration options
| Parameter | Possible Values | Description |
|---|---|---|
licensedCountryCodes | ISO3166-2 country codes with a semicolon (;) separator. For example, US;IN;RU. If blank, all countries are considered. | The licensedCountryCodes parameter restricts phone cleansing to the specified countries. If it's omitted, phone numbers from all countries are supported.
You can configure
|
returnDataForInValidStatus | The following options are available:
| The returnDataForInValidStatus option is considered when ValidationStatus is INVALID. The following points explain how the returnDataForInValidStatus option works:
|
enhanceCleansing | The following options are available:
| The enhanceCleansing option is active only when ValidationStatus is INVALID. The following points explain how the enhanceCleansing option works:
|
formatType | The following format types are supported:
| This option determines the output format of the phone number. The default format is NATIONAL. For example:
|
Cleanser mapping and L3 examples
ConfigurePhoneCleanserFn in the L3 configuration by mapping the nested phone attribute to the cleanser input and output fields. {
"attribute": "configuration/entityTypes/HCP/attributes/Phone/attributes/Number",
"mandatory": true,
"allValues": true,
"cleanseAttribute": "Number"
}
{
"uri": "configuration/entityTypes/HCP",
"cleanseConfig": {
"infos": [
{
"uri": "configuration/entityTypes/HCP/cleanse/infos/PhoneCleanserFn1",
"useInCleansing": true,
"sequence": [
{
"chain": [
{
"cleanseFunction": "PhoneCleanserFn",
"resultingValuesSourceTypeUri": "configuration/sources/ReltioCleanser",
"proceedOnSuccess": true,
"proceedOnFailure": true,
"params": {
"licensedCountryCodes": "US",
"formatType": "E164"
},
"mapping": {
"inputMapping": [
{
"attribute": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/Number",
"mandatory": true,
"allValues": true,
"cleanseAttribute": "Number"
},
{
"attribute": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/CountryCode",
"mandatory": false,
"allValues": true,
"cleanseAttribute": "CountryCode"
},
{
"attribute": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/Type",
"mandatory": false,
"allValues": true,
"cleanseAttribute": "Type"
}
],
"outputMapping": [
{
"attribute": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/Type",
"mandatory": false,
"allValues": false,
"cleanseAttribute": "Type"
},
{
"attribute": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/Number",
"mandatory": true,
"allValues": false,
"cleanseAttribute": "Number"
},
{
"attribute": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/CountryCode",
"mandatory": false,
"allValues": false,
"cleanseAttribute": "CountryCode"
},
{
"attribute": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/Extension",
"mandatory": false,
"allValues": false,
"cleanseAttribute": "Extension"
},
{
"attribute": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/LineType",
"mandatory": false,
"allValues": false,
"cleanseAttribute": "LineType"
},
{
"attribute": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/FormatMask",
"mandatory": false,
"allValues": false,
"cleanseAttribute": "FormatMask"
},
{
"attribute": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/ValidationStatus",
"mandatory": true,
"allValues": false,
"cleanseAttribute": "ValidationStatus"
},
{
"attribute": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/AreaCode",
"mandatory": false,
"allValues": false,
"cleanseAttribute": "AreaCode"
},
{
"attribute": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/GeoCountry",
"mandatory": false,
"allValues": false,
"cleanseAttribute": "GeoCountry"
},
{
"attribute": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/GeoArea",
"mandatory": false,
"allValues": false,
"cleanseAttribute": "GeoArea"
},
{
"attribute": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/DigitCount",
"mandatory": false,
"allValues": false,
"cleanseAttribute": "DigitCount"
},
{
"attribute": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/LocalNumber",
"mandatory": false,
"allValues": false,
"cleanseAttribute": "LocalNumber"
},
{
"attribute": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/CarrierInfo",
"mandatory": false,
"allValues": false,
"cleanseAttribute": "CarrierInfo"
},
{
"attribute": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/FormattedNumber",
"mandatory": true,
"allValues": false,
"cleanseAttribute": "FormattedNumber"
},
{
"attribute": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/FormattedNumber-NATIONAL",
"mandatory": false,
"allValues": false,
"cleanseAttribute": "FormattedNumber-NATIONAL"
},
{
"attribute": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/FormattedNumber-INTERNATIONAL",
"mandatory": false,
"allValues": false,
"cleanseAttribute": "FormattedNumber-INTERNATIONAL"
},
{
"attribute": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/FormattedNumber-E164",
"mandatory": false,
"allValues": false,
"cleanseAttribute": "FormattedNumber-E164"
},
{
"attribute": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/FormattedNumber-RFC3966",
"mandatory": false,
"allValues": false,
"cleanseAttribute": "FormattedNumber-RFC3966"
}
]
}
}
]
}
],
"nestedAttributeToCleanse": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone"
}
]
},
"attributes": [
{
"uri": "configuration/entityTypes/HCP/attributes/ID",
"label": "ID",
"name": "ID",
"description": "",
"type": "String",
"hidden": false,
"important": false,
"attributeOrdering": {
"orderingStrategy": "LUD"
}
},
{
"uri": "configuration/entityTypes/HCP/attributes/FirstName",
"label": "First Name",
"name": "FirstName",
"description": "",
"type": "String",
"hidden": false,
"important": false,
"attributeOrdering": {
"orderingStrategy": "LUD"
}
},
{
"uri": "configuration/entityTypes/HCP/attributes/MiddleName",
"label": "Middle Name",
"name": "MiddleName",
"description": "",
"type": "String",
"hidden": false,
"important": false,
"attributeOrdering": {
"orderingStrategy": "LUD"
}
},
{
"uri": "configuration/entityTypes/HCP/attributes/LastName",
"label": "Last Name",
"name": "LastName",
"description": "",
"type": "String",
"hidden": false,
"important": false,
"attributeOrdering": {
"orderingStrategy": "LUD"
}
},
{
"uri": "configuration/entityTypes/HCP/attributes/Initial",
"label": "Initial",
"name": "Initial",
"description": "",
"type": "String",
"hidden": false,
"important": false,
"attributeOrdering": {
"orderingStrategy": "LUD"
}
},
{
"uri": "configuration/entityTypes/HCP/attributes/Name",
"label": "Name",
"name": "Name",
"description": "",
"type": "String",
"hidden": false,
"important": false,
"attributeOrdering": {
"orderingStrategy": "LUD"
}
},
{
"uri": "configuration/entityTypes/HCP/attributes/Address",
"label": "Address",
"name": "Address",
"description": "",
"type": "Nested",
"hidden": false,
"important": false,
"attributeOrdering": {
"orderingStrategy": "LUD"
},
"attributes": [
{
"label": "City",
"name": "City",
"type": "String",
"hidden": false,
"important": false,
"system": false,
"faceted": true,
"searchable": true,
"attributeOrdering": {
"orderingStrategy": "LUD"
},
"uri": "configuration/entityTypes/HCP/attributes/Address/attributes/City",
"skipInDataAccess": false
},
{
"label": "State",
"name": "StateProvince",
"type": "String",
"hidden": false,
"important": false,
"system": false,
"faceted": true,
"searchable": true,
"attributeOrdering": {
"orderingStrategy": "LUD"
},
"uri": "configuration/entityTypes/HCP/attributes/Address/attributes/StateProvince",
"lookupCode": "STATE_CODE",
"skipInDataAccess": false
},
{
"label": "Zip",
"name": "Zip",
"type": "Nested",
"hidden": false,
"important": false,
"system": false,
"faceted": false,
"searchable": true,
"attributeOrdering": {
"orderingStrategy": "LUD"
},
"uri": "configuration/entityTypes/HCP/attributes/Address/attributes/Zip",
"dataLabelPattern": "{Zip5}-{Zip4}",
"attributes": [
{
"label": "Zip4",
"name": "Zip4",
"type": "String",
"hidden": false,
"important": false,
"system": false,
"faceted": false,
"searchable": true,
"attributeOrdering": {
"orderingStrategy": "LUD"
},
"uri": "configuration/entityTypes/HCP/attributes/Address/attributes/Zip/attributes/Zip4",
"skipInDataAccess": false
},
{
"label": "Zip5",
"name": "Zip5",
"type": "String",
"hidden": false,
"important": false,
"system": false,
"faceted": false,
"searchable": true,
"attributeOrdering": {
"orderingStrategy": "LUD"
},
"uri": "configuration/entityTypes/HCP/attributes/Address/attributes/Zip/attributes/Zip5",
"skipInDataAccess": false
}
],
"skipInDataAccess": false
},
{
"label": "Address Input",
"name": "AddressInput",
"type": "Blob",
"hidden": false,
"important": false,
"system": false,
"attributeOrdering": {
"orderingStrategy": "LUD"
},
"uri": "configuration/entityTypes/HCP/attributes/Address/attributes/AddressInput",
"skipInDataAccess": false
},
{
"label": "Address Line 1",
"name": "AddressLine1",
"type": "String",
"hidden": false,
"important": false,
"system": false,
"attributeOrdering": {
"orderingStrategy": "LUD"
},
"uri": "configuration/entityTypes/HCP/attributes/Address/attributes/AddressLine1",
"skipInDataAccess": false
},
{
"label": "Address Line 2",
"name": "AddressLine2",
"type": "String",
"hidden": false,
"important": false,
"system": false,
"attributeOrdering": {
"orderingStrategy": "LUD"
},
"uri": "configuration/entityTypes/HCP/attributes/Address/attributes/AddressLine2",
"skipInDataAccess": false
},
{
"label": "Country",
"name": "Country",
"type": "String",
"hidden": false,
"important": false,
"system": false,
"attributeOrdering": {
"orderingStrategy": "LUD"
},
"uri": "configuration/entityTypes/HCP/attributes/Address/attributes/Country",
"skipInDataAccess": false
},
{
"label": "Country Name",
"name": "CountryName",
"description": "DO NOT USE this field - use Country instead",
"type": "String",
"hidden": false,
"important": false,
"system": false,
"attributeOrdering": {
"orderingStrategy": "LUD"
},
"uri": "configuration/entityTypes/HCP/attributes/Address/attributes/CountryName",
"skipInDataAccess": false
},
{
"label": "Phone",
"name": "Phone",
"type": "Nested",
"hidden": false,
"important": false,
"system": false,
"required": false,
"attributeOrdering": {
"fieldURI": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/Rank",
"orderType": "ASC",
"orderingStrategy": "FieldBased"
},
"uri": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone",
"dataLabelPattern": "{Type} {Number}",
"matchFieldURIs": [
"configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/FormattedNumber"
],
"attributes": [
{
"label": "Type*",
"name": "Type",
"description": "",
"type": "String",
"hidden": false,
"important": false,
"system": false,
"required": false,
"values": [
"Mobile",
"Home",
"Work",
"Fax",
"Main",
"Work Fax",
"Home Fax",
"Pager",
"Other"
],
"attributeOrdering": {
"orderingStrategy": "LUD"
},
"uri": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/Type"
},
{
"label": "Number*",
"name": "Number",
"description": "",
"type": "String",
"hidden": false,
"important": false,
"system": false,
"required": false,
"attributeOrdering": {
"orderingStrategy": "LUD"
},
"uri": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/Number"
},
{
"label": "Country Code*",
"name": "CountryCode",
"description": "",
"type": "String",
"hidden": false,
"important": false,
"system": false,
"required": false,
"values": [
"US",
"IN",
"GB",
"AU"
],
"attributeOrdering": {
"orderingStrategy": "LUD"
},
"uri": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/CountryCode"
},
{
"label": "Extension",
"name": "Extension",
"description": "",
"type": "String",
"hidden": false,
"important": false,
"system": false,
"required": false,
"attributeOrdering": {
"orderingStrategy": "LUD"
},
"uri": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/Extension"
},
{
"label": "Formatted Number",
"name": "FormattedNumber",
"type": "String",
"hidden": false,
"important": false,
"system": false,
"required": false,
"attributeOrdering": {
"orderingStrategy": "LUD"
},
"uri": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/FormattedNumber"
},
{
"label": "National Formatted Number",
"name": "FormattedNumber-NATIONAL",
"type": "String",
"hidden": false,
"important": false,
"system": false,
"required": false,
"attributeOrdering": {
"orderingStrategy": "LUD"
},
"uri": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/FormattedNumber-NATIONAL"
},
{
"label": "International Formatted Number",
"name": "FormattedNumber-INTERNATIONAL",
"type": "String",
"hidden": false,
"important": false,
"system": false,
"required": false,
"attributeOrdering": {
"orderingStrategy": "LUD"
},
"uri": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/FormattedNumber-INTERNATIONAL"
},
{
"label": "E164 Formatted Number",
"name": "FormattedNumber-E164",
"type": "String",
"hidden": false,
"important": false,
"system": false,
"required": false,
"attributeOrdering": {
"orderingStrategy": "LUD"
},
"uri": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/FormattedNumber-E164"
},
{
"label": "RFC3966 Formatted Number",
"name": "FormattedNumber-RFC3966",
"type": "String",
"hidden": false,
"important": false,
"system": false,
"required": false,
"attributeOrdering": {
"orderingStrategy": "LUD"
},
"uri": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/FormattedNumber-RFC3966"
},
{
"label": "Rank",
"name": "Rank",
"description": "",
"type": "Int",
"hidden": false,
"important": false,
"system": false,
"required": false,
"attributeOrdering": {
"orderingStrategy": "LUD"
},
"uri": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/Rank"
},
{
"label": "Area Code",
"name": "AreaCode",
"description": "",
"type": "String",
"hidden": false,
"important": false,
"system": false,
"required": false,
"attributeOrdering": {
"orderingStrategy": "LUD"
},
"uri": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/AreaCode"
},
{
"label": "Local Number",
"name": "LocalNumber",
"description": "",
"type": "String",
"hidden": false,
"important": false,
"system": false,
"required": false,
"attributeOrdering": {
"orderingStrategy": "LUD"
},
"uri": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/LocalNumber"
},
{
"label": "Validation Status",
"name": "ValidationStatus",
"description": "",
"type": "String",
"hidden": false,
"important": false,
"system": false,
"required": false,
"attributeOrdering": {
"orderingStrategy": "LUD"
},
"uri": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/ValidationStatus"
},
{
"label": "Line Type",
"name": "LineType",
"description": "",
"type": "String",
"hidden": false,
"important": false,
"system": false,
"required": false,
"attributeOrdering": {
"orderingStrategy": "LUD"
},
"uri": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/LineType"
},
{
"label": "Format Mask",
"name": "FormatMask",
"description": "",
"type": "String",
"hidden": false,
"important": false,
"system": false,
"required": false,
"attributeOrdering": {
"orderingStrategy": "LUD"
},
"uri": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/FormatMask"
},
{
"label": "Digit Count",
"name": "DigitCount",
"description": "",
"type": "Int",
"hidden": false,
"important": false,
"system": false,
"required": false,
"attributeOrdering": {
"orderingStrategy": "LUD"
},
"uri": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/DigitCount"
},
{
"label": "Geo Area",
"name": "GeoArea",
"description": "",
"type": "String",
"hidden": false,
"important": false,
"system": false,
"required": false,
"attributeOrdering": {
"orderingStrategy": "LUD"
},t
"uri": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/GeoArea"
},
{
"label": "Geo Country",
"name": "GeoCountry",
"description": "",
"type": "String",
"hidden": false,
"important": false,
"system": false,
"required": false,
"attributeOrdering": {
"orderingStrategy": "LUD"
},
"uri": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/GeoCountry"
},
{
"label": "CarrierInfo",
"name": "CarrierInfo",
"description": "",
"type": "String",
"hidden": true,
"important": false,
"system": false,
"required": false,
"attributeOrdering": {
"orderingStrategy": "LUD"
},
"uri": "configuration/entityTypes/HCP/attributes/Address/attributes/Phone/attributes/CarrierInfo"
}
]
}
]
}
]
}
Example to understand the input and output fields
| Options | Input Fields | Output Fields |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ "licensedCountryCodes" : "RU;IN" } |
|
|
{ "formatType" : "E164" } |
|
|
Best practices for phone cleansing
- Always provide a country code
- Prevents incorrect defaulting to US
- Supports precise validation and formatting
- Enable
enhanceCleansingfor messy input data- Automatically retries invalid numbers with a
+prefix - Helps recover incomplete or poorly formatted values
- Automatically retries invalid numbers with a
- Choose the right
formatTypefor your use caseE164: Recommended for storage, integrations, and APIsNATIONAL: Suitable for local display (UI)INTERNATIONAL: Preferred for human-readable formatting across countries
- Set
returnDataForInValidStatus = trueif you need metadata on invalid inputs- Useful for debugging, partial enrichment, and data profiling
- Use
licensedCountryCodesto restrict processing- Helps with compliance, cost control, or targeting specific markets