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

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

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

Example 1: Form Submission Cleanup

Workflow: 1. Website Form 2. Phone Formatter - Clean phone 3. If Task - Validate 4. Match to Client - Find/update contact

Phone Formatter:

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

Validation:

If {{task_24001_is_valid}} = false:
  Email admin: Invalid phone submitted
  Stop workflow

Match to Client:

Phone: {{task_24001_e164}}
(Consistent format for matching)

Example 2: SMS Campaign with International Numbers

Workflow: 1. MySQL Query - Get contacts 2. Loop - Process each 3. Phone Formatter - Format for SMS 4. If Task - Check valid 5. SMS Task - Send message

Phone Formatter:

Input: {{task_29001_phone}}
Country: {{task_29001_country_code}}
Default: US

Validation:

If {{task_24001_is_valid}} = true:
  Send SMS to {{task_24001_e164}}

Example 3: Display Formatting

Workflow: 1. CRM Trigger - Contact viewed 2. Phone Formatter - Format phones 3. Webhook Out - Send to display

Format multiple phones:

Phone 1: {{task_47001_phone}}
→ Display: {{task_24001_international}}

Phone 2: {{task_47001_mobile}}
→ Display: {{task_24002_international}}

Webhook body:

{
  "contact_id": "{{task_47001_contact_id}}",
  "phones": {
    "office": "{{task_24001_international}}",
    "mobile": "{{task_24002_international}}"
  }
}

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