Skip to content

Phone Formatter Task

Overview

The Phone Formatter Task turns a phone number into E.164 — + and the country code, then the number, with no spaces (+27825550111) — the form SMS, WhatsApp and number matching all expect. It also checks the number is a real one for its country.

When to use this task:

  • Standardise numbers from form submissions before matching on them
  • Prepare a number for an SMS or WhatsApp task
  • Clean imported numbers

Key Features:

  • One output: the number in E.164
  • Any country, chosen from the list or given as a {{variable}}
  • Numbers that are not valid for the country fail the task

Collecting the number on a BaseCloud website form?

Give the form a Phone Number field instead. The visitor picks their country, the form checks the number before it is sent, and your workflow receives it in E.164 already, so this task is not needed. See Phone Number Fields.

The Phone Number Formatter task opened to its settings: Country set to United States and Phone Number holding the phone variable from the trigger

Quick Start

  1. Add the Phone Formatter task
  2. Choose the Country the numbers are from (South Africa by default)
  3. Set Phone Number — usually a {{variable}} from an earlier task
  4. Save

Simple Example:

Country:      South Africa (ZA)
Phone Number: {{task_55001_phone}}        (082 555 0111)
Output:       {{task_24001_phone_number_output}} = +27825550111

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 –

Country

The country says how to read a number written without its country code — 082 555 0111 is a South African number only if the country is ZA. A number that already starts with + and its country code is read as written, whichever country is chosen.

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
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, in E.164 (+27825550111). A number that cannot be read fails the task instead — see below.

When the task fails

The run fails — and the tasks after it do not run — when:

  • No country is chosen, or no phone number is given
  • The number is not a valid number for its country — too short, too long, or not a number at all

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}}

Examples by Country

Country Input Output
South Africa (ZA) 082 555 0111, 0825550111, +27 82 555 0111 +27825550111
United Kingdom (GB) 020 7123 4567, +44 20 7123 4567 +442071234567
United States (US) (555) 123-4567, 555-123-4567 +15551234567 (a real number)
Australia (AU) (02) 1234 5678, +61 2 1234 5678 +61212345678

Best Practices

  1. Store E.164 — one consistent form makes numbers matchable and searchable
  2. Choose the country the numbers come from — it decides how a number without + is read
  3. Format before you match or send — Match to Client and SMS both work best with E.164

Troubleshooting

Number could not be formatted

  1. Is the Country the one the number is from?
  2. Does the number have the right number of digits for that country?
  3. Is it really a phone number? Placeholder text like "n/a" fails.

The run's message shows the number it was given.

Frequently Asked Questions

What's E.164 format?

The international standard: +, the country code, then the number — no spaces, dashes or brackets. For example +27825550111.

Can it give a display format like (555) 123-4567?

No — the output is always E.164.

Can it tell mobile from landline?

No. It checks the number is valid for its country, not what kind of line it is.

Can I format several numbers in one task?

No — use a Phone Formatter task per number.