Skip to content

Phone Formatter Task

Overview

The Phone Formatter Task standardizes phone numbers into consistent formats. Use it to clean data, ensure E.164 compliance for SMS/calling systems, display formatted numbers, or validate phone inputs.

When to use this task:

  • Standardize phone numbers from form submissions
  • Format for SMS sending (E.164)
  • Display user-friendly formats
  • Validate phone number format
  • Clean imported data
  • Convert between international formats
  • Remove invalid characters

Key Features:

  • Multiple format outputs
  • International country code support
  • Automatic country detection
  • Remove special characters
  • E.164 compliance for APIs
  • Display formats for UI
  • Validation and error handling

Quick Start

  1. Add Phone Formatter task
  2. Input phone number field
  3. Select country (or auto-detect)
  4. Choose output format
  5. Save

Simple Example:

Input: {{task_49001_phone}}
Country: US
Output: {{task_24001_e164}} = +15551234567

Configuration

Builder fields

The Field column is the label as it appears in the task builder; Key is the name the value is stored under and referenced by.

Field Key Type Default Notes
Country country_code select ZA Options: Ascension Island (AC) · Andorra (AD) · United Arab Emirates (AE) · Afghanistan (AF) · Antigua & Barbuda (AG) · Anguilla (AI) · Albania (AL) · Armenia (AM) · Angola (AO) · Antarctica (AQ) · Argentina (AR) · American Samoa (AS) · Austria (AT) · Australia (AU) · Aruba (AW) · Åland Islands (AX) · Azerbaijan (AZ) · Bosnia & Herzegovina (BA) · Barbados (BB) · Bangladesh (BD) · Belgium (BE) · Burkina Faso (BF) · Bulgaria (BG) · Bahrain (BH) · Burundi (BI) · Benin (BJ) · St. Barthélemy (BL) · Bermuda (BM) · Brunei (BN) · Bolivia (BO) · Caribbean Netherlands (BQ) · Brazil (BR) · Bahamas (BS) · Bhutan (BT) · Botswana (BW) · Belarus (BY) · Belize (BZ) · Canada (CA) · Cocos (Keeling) Islands (CC) · Congo - Kinshasa (CD) · Central African Republic (CF) · Congo - Brazzaville (CG) · Switzerland (CH) · Cook Islands (CK) · Chile (CL) · Cameroon (CM) · China (CN) · Colombia (CO) · Sark (CQ) · Costa Rica (CR) · Cuba (CU) · Cape Verde (CV) · Curaçao (CW) · Christmas Island (CX) · Cyprus (CY) · Czechia (CZ) · Germany (DE) · Diego Garcia (DG) · Djibouti (DJ) · Denmark (DK) · Dominica (DM) · Dominican Republic (DO) · Algeria (DZ) · Ceuta & Melilla (EA) · Ecuador (EC) · Estonia (EE) · Egypt (EG) · Western Sahara (EH) · Eritrea (ER) · Spain (ES) · Ethiopia (ET) · Finland (FI) · Fiji (FJ) · Falkland Islands (FK) · Micronesia (FM) · Faroe Islands (FO) · France (FR) · Gabon (GA) · United Kingdom (GB) · Grenada (GD) · Georgia (GE) · French Guiana (GF) · Guernsey (GG) · Ghana (GH) · Gibraltar (GI) · Greenland (GL) · Gambia (GM) · Guinea (GN) · Guadeloupe (GP) · Equatorial Guinea (GQ) · Greece (GR) · South Georgia & South Sandwich Islands (GS) · Guatemala (GT) · Guam (GU) · Guinea-Bissau (GW) · Guyana (GY) · Hong Kong SAR China (HK) · Honduras (HN) · Croatia (HR) · Haiti (HT) · Hungary (HU) · Canary Islands (IC) · Indonesia (ID) · Ireland (IE) · Israel (IL) · Isle of Man (IM) · India (IN) · British Indian Ocean Territory (IO) · Iraq (IQ) · Iran (IR) · Iceland (IS) · Italy (IT) · Jersey (JE) · Jamaica (JM) · Jordan (JO) · Japan (JP) · Kenya (KE) · Kyrgyzstan (KG) · Cambodia (KH) · Kiribati (KI) · Comoros (KM) · St. Kitts & Nevis (KN) · North Korea (KP) · South Korea (KR) · Kuwait (KW) · Cayman Islands (KY) · Kazakhstan (KZ) · Laos (LA) · Lebanon (LB) · St. Lucia (LC) · Liechtenstein (LI) · Sri Lanka (LK) · Liberia (LR) · Lesotho (LS) · Lithuania (LT) · Luxembourg (LU) · Latvia (LV) · Libya (LY) · Morocco (MA) · Monaco (MC) · Moldova (MD) · Montenegro (ME) · St. Martin (MF) · Madagascar (MG) · Marshall Islands (MH) · North Macedonia (MK) · Mali (ML) · Myanmar (Burma) (MM) · Mongolia (MN) · Macao SAR China (MO) · Northern Mariana Islands (MP) · Martinique (MQ) · Mauritania (MR) · Montserrat (MS) · Malta (MT) · Mauritius (MU) · Maldives (MV) · Malawi (MW) · Mexico (MX) · Malaysia (MY) · Mozambique (MZ) · Namibia (NA) · New Caledonia (NC) · Niger (NE) · Norfolk Island (NF) · Nigeria (NG) · Nicaragua (NI) · Netherlands (NL) · Norway (NO) · Nepal (NP) · Nauru (NR) · Niue (NU) · New Zealand (NZ) · Oman (OM) · Panama (PA) · Peru (PE) · French Polynesia (PF) · Papua New Guinea (PG) · Philippines (PH) · Pakistan (PK) · Poland (PL) · St. Pierre & Miquelon (PM) · Pitcairn Islands (PN) · Puerto Rico (PR) · Palestinian Territories (PS) · Portugal (PT) · Palau (PW) · Paraguay (PY) · Qatar (QA) · Réunion (RE) · Romania (RO) · Serbia (RS) · Russia (RU) · Rwanda (RW) · Saudi Arabia (SA) · Solomon Islands (SB) · Seychelles (SC) · Sudan (SD) · Sweden (SE) · Singapore (SG) · St. Helena (SH) · Slovenia (SI) · Svalbard & Jan Mayen (SJ) · Slovakia (SK) · Sierra Leone (SL) · San Marino (SM) · Senegal (SN) · Somalia (SO) · Suriname (SR) · South Sudan (SS) · São Tomé & Príncipe (ST) · El Salvador (SV) · Sint Maarten (SX) · Syria (SY) · Eswatini (SZ) · Tristan da Cunha (TA) · Turks & Caicos Islands (TC) · Chad (TD) · French Southern Territories (TF) · Togo (TG) · Thailand (TH) · Tajikistan (TJ) · Tokelau (TK) · Timor-Leste (TL) · Turkmenistan (TM) · Tunisia (TN) · Tonga (TO) · Türkiye (TR) · Trinidad & Tobago (TT) · Tuvalu (TV) · Taiwan (TW) · Tanzania (TZ) · Ukraine (UA) · Uganda (UG) · U.S. Outlying Islands (UM) · United States (US) · Uruguay (UY) · Uzbekistan (UZ) · Vatican City (VA) · St. Vincent & Grenadines (VC) · Venezuela (VE) · British Virgin Islands (VG) · U.S. Virgin Islands (VI) · Vietnam (VN) · Vanuatu (VU) · Wallis & Futuna (WF) · Samoa (WS) · Kosovo (XK) · Yemen (YE) · Mayotte (YT) · South Africa (ZA) · Zambia (ZM) · Zimbabwe (ZW)
Phone Number phone_number text –

Input Phone Number

From form:

Phone Number: {{task_49001_phone}}

From contact:

Phone Number: {{task_47001_phone}}

From database:

Phone Number: {{task_43001_customer_phone}}

Country Selection

Fixed country:

Country Code: US

Dynamic country:

Country Code: {{task_49001_country}}

Auto-detect:

Country Code: Auto

(Detects from number format or defaults to account settings)

Default Country

If phone has no country code and auto-detect fails:

Default Country: US

Outputs

Field Type Example Notes
phone_number_input string 082 555 0111 The number as received, before formatting.
phone_number_output string +27825550111 The formatted number — the field to use downstream.
run boolean true false when the number could not be parsed.
run_text string Phone number formatted.

There is no is_valid, e164, national or international field: the task produces one formatted value in phone_number_output. Check run to know whether formatting succeeded.

Output Formats

The Phone Formatter provides multiple formatted versions:

Field Format Example Use Case
task_24001_e164 +[country][number] +15551234567 SMS/calling APIs
task_24001_international +[country] [formatted] +1 555-123-4567 Display
task_24001_national [formatted without country] (555) 123-4567 Local display
task_24001_rfc3966 tel:+[country][number] tel:+15551234567 Click-to-call links
task_24001_digits_only [numbers only] 5551234567 Storage/comparison
task_24001_country_code [country code] US Metadata
task_24001_is_valid true/false true Validation

Common Patterns

Format for SMS

Phone: {{task_49001_phone}}
Country: US

Use for SMS: {{task_24001_e164}}
Result: +15551234567

Display Formatted

Show on website: {{task_24001_international}}
Result: +1 555-123-4567

Show locally: {{task_24001_national}}
Result: (555) 123-4567
<a href="{{task_24001_rfc3966}}">Call Us</a> Result: <a href="tel:+15551234567">Call Us</a>

Validate Phone

If {{task_24001_is_valid}} = true:
  → Continue workflow
If {{task_24001_is_valid}} = false:
  → Send error notification

Clean for Storage

Store: {{task_24001_e164}}

Always use E.164 for database storage (consistent, searchable).

Real-World Examples

Normalise a number before matching on it

Form Submission
  └─ Phone Formatter       format the submitted number
      └─ Match to Client   contact_cell_number: {{task_24001_phone_number_output}}

This is the most common use. Matching compares known formats of the same number, so feeding it a normalised value is what makes a match land reliably.

Clean a number before sending an SMS

Webhook In
  └─ Phone Formatter   format to E.164
      └─ SMS           to {{task_24001_phone_number_output}}

Check a number is usable at all

Form Submission
  └─ Phone Formatter   format the number
      └─ If Statement  run is true → continue, false → ask the customer to re-enter

run is false when the value could not be parsed, so it doubles as a validity check.

Country-Specific Formats

United States (US)

Input variations:

  • 555-123-4567
  • (555) 123-4567
  • 5551234567
  • +1 555-123-4567

Outputs:

  • E.164: +15551234567
  • National: (555) 123-4567
  • International: +1 555-123-4567

United Kingdom (GB)

Input variations:

  • 020 7123 4567
  • +44 20 7123 4567
  • 02071234567

Outputs:

  • E.164: +442071234567
  • National: 020 7123 4567
  • International: +44 20 7123 4567

South Africa (ZA)

Input variations:

  • 011 123 4567
  • +27 11 123 4567
  • 0111234567

Outputs:

  • E.164: +27111234567
  • National: 011 123 4567
  • International: +27 11 123 4567

Australia (AU)

Input variations:

  • (02) 1234 5678
  • +61 2 1234 5678
  • 0212345678

Outputs:

  • E.164: +61212345678
  • National: (02) 1234 5678
  • International: +61 2 1234 5678

Best Practices

Always Validate

1. Phone Formatter
2. If Task - Check {{task_24001_is_valid}}
3. Only proceed if valid

Store E.164

Always save {{task_24001_e164}} to database:

  • Consistent format
  • Searchable
  • SMS/API compatible

Display International

Show {{task_24001_international}} to users:

  • Clear country code
  • User-friendly format
  • Click-to-call compatible

Handle Missing Country

Input: {{task_49001_phone}}
Country: {{task_49001_country}}
Default Country: US

If {{task_49001_country}} empty, uses US as fallback.

Clean Before Format

Remove known invalid characters:

// In Code task before Phone Formatter
let phone = input.task_49001_phone || '';
phone = phone.replace(/[^0-9+]/g, ''); // Keep only digits and +
return { cleaned_phone: phone };

Then format: {{task_42001_cleaned_phone}}

Troubleshooting

Phone Shows as Invalid

Check:

  1. Country code correct?
  2. Number has enough digits?
  3. Number format matches country?

Common issues:

  • Missing country code when needed
  • Extra digits
  • Wrong country selected

Debug:

View {{task_24001_is_valid}} in execution history
Check original input value

E.164 Format Wrong

Issue: {{task_24001_e164}} = 15551234567 (missing +)

Cause: Using digits_only instead of e164

Solution: Always use {{task_24001_e164}} for API calls.

Country Not Detected

Issue: Auto-detect fails

Solution: Set default country:

Country: Auto
Default Country: US

International Format Not Showing

Issue: Shows national format

Cause: Input didn't include country code

Solution:

  1. Specify country in task
  2. Or include + in input: +1 555-123-4567

Frequently Asked Questions

What's E.164 format?

International standard: +\[country code\]\[number\]

  • No spaces, dashes, parentheses
  • Starts with +
  • Example: +15551234567

Why store E.164 format?

  • Consistent across all countries
  • Required for SMS/calling APIs
  • Easier to search/match
  • Prevents duplicates

Can it validate mobile vs landline?

No, it validates format only. Use carrier lookup service for mobile detection.

What if country is unknown?

Set default country in task configuration. Most common: US, GB, ZA.

Can I format multiple phones in one task?

No, use separate Phone Formatter task for each number:

Task 1: Format {{task_47001_phone}}
Task 2: Format {{task_47001_mobile}}

Does it work with extensions?

No, extensions should be stored separately:

Phone: +15551234567
Extension: 123

How do I handle toll-free numbers?

Format normally. Examples:

  • US: +18001234567
  • GB: +448001234567

  • SMS Task - Send to {{task_24001_e164}}
  • Match to Client - Match by formatted phone
  • Edit Client - Update with clean format
  • If Task - Validate before proceeding
  • Code Task - Additional phone processing