• Skip to main content
  • Skip to footer

Design Prodigy | Digital Marketing Agency In Singapore

  • Home
  • ABOUT US
    • Our Philosophy
    • Our Method
    • Our Clients
    • Team
    • Careers
    • Internship
    • Content Creator
    • Intervarsity UnGPTable Challenge (B2B Marketing)
    • Intervarsity UnGPTable Challenge (ESG)
    • Partner Programme
  • Fearless 20
  • Marketo
  • B2B Marketing
    • Full Funnel Marketing
    • Lead Generation
  • Magazine
    • MarTech
  • Contact
Part 2: Flowboost – Phone Number Cleaning Script

Part 2: Flowboost – Phone Number Cleaning Script

By Yuanwen

Following the initial post in our series on using FlowBoost with Marketo, we now delve into the details of implementing a basic phone number cleaning script. This post is the second of our three part Flowboost series and explores how to leverage Flowboost’s capabilities to clean and standardize phone numbers in your Marketo environment.

As a quick recap, Flowboost is the brainchild of legendary Marketo veterans Sanford Whiteman, and Edward Unthank of Etumos. In this 3 part-series we will go through:

  • Part 1: What can Flowboost Do + The basic setup of Flowboost
  • Part 2: Using Flowboost for basic phone number data cleaning
  • Part 3 [Coming Soon]: Proper capitalisation of First and Last Names value when new persons are created in Marketo + Advantages & Limitations of the Community Edition of Flowboost

This blogpost references many steps from Part 1 of our series, so be sure to take a look and try out what we wrote in Part 1 if you haven’t already, before attempting the steps below.

Get Started

Now as we all know, phone numbers may come in different formats, such as:

  • +1 234 567 8901
  • 12345678901
  • 1-234-567-8901
  • 123 456 789 01

Today we’ll go through a simple phone number cleaning script that removes all non-numeric characters from the field values except for leading plus signs for phone numbers containing the country code.

Set-up Process

1. Clone the webhook you created in the first blogpost

Give it an appropriate name that indicates the purpose of the webhook clearly.

2. Edit the payload and replace it with the following:

a. This script removes all non-numeric characters from the field values except for leading plus signs for phone numbers containing the country code.

mobilenumber = {{lead.Mobile Phone Number}}; 
function removeNonNumericalChars(str) {
  // Check for a leading plus sign and store the condition
    const hasLeadingPlus = str.startsWith('+');
  
    // Remove all non-numeric characters
    let cleanedStr = str.replace(/[^0-9]/g, '');
  
    // Prepend the plus sign if the original string had it
    if (hasLeadingPlus) {
        cleanedStr = '+' + cleanedStr;
    }
  
    return cleanedStr;}
var cleanedMobileNumber = removeNonNumericalChars(mobilenumber);

It should look something like this:

b. You might need to change the tokens to the correct field names that you are using to store the phone numbers. For instance, if you are storing the phone number in a custom field named “Personal Phone”, the Marketo token you’re using might be named {{lead.Personal Phone}} and you will need to update the code to something like this instead.

mobilenumber = {{lead.Personal Phone}}; 
function removeNonNumericalChars(str) {
  // Check for a leading plus sign and store the condition
    const hasLeadingPlus = str.startsWith('+');
  
    // Remove all non-numeric characters
    let cleanedStr = str.replace(/[^0-9]/g, '');
  
    // Prepend the plus sign if the original string had it
    if (hasLeadingPlus) {
        cleanedStr = '+' + cleanedStr;
    }
  
    return cleanedStr;}
var cleanedMobileNumber = removeNonNumericalChars(mobilenumber);

Now to test your webhook

3. Test your webhook by following a similar testing procedure as in our Part 1 blogpost

a. Create or edit the phone numbers of your test leads with some irregular phone number formatting

b. Create a Batch Smart Campaign and a Trigger Smart CampaignBatch Campaign will request the Trigger Smart Campaign

Batch Campaign will request the Trigger Smart Campaign

The Trigger Smart Campaign will call the webhook

c. Check to see that the smart campaign has run correctly

Conclusion

And that’s all there is to it! Wasn’t that easy? Now you can use this phone-number cleaning webhook however you like!

  • You could call the webhook every time a new Person is created in Marketo with a non-empty Phone Number field.
  • Or perhaps you can get it to run everytime someone fills up a form.
  • You could also schedule to run it periodically every 6 months or so by setting some campaign rules and using a batch campaign to call on the webhook every 6 months or so.

Do note that there are certain limits quotas the free community version of Flowboost is subjected to, as we have covered in Part 1.

Have fun experimenting and if you have any comments or questions leave them down below for us!

Yuanwen
Yuanwen

Footer

41C Boat Quay, Singapore 049830
e: info@dp.sg
t: +65 8100 8873
f: +65 6399 3699

ABOUT US

Our Philosophy
Our Method
Our Clients
Team
Careers
Internship
Partner Programme

SOLUTIONS & SERVICES

Marketo
B2B Full-Funnel Marketing
B2B Lead Generation

  • Terms & Conditions
  • Privacy Policy
  • Sitemap

Copyright © 2025 Design Prodigy Pte Ltd. All Rights Reserved.

This website uses cookies to improve your experience. You can opt out if you wish. Accept Read More
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
SAVE & ACCEPT
  • Home
  • ABOUT US
    ▼
    • Our Philosophy
    • Our Method
    • Our Clients
    • Team
    • Careers
    • Internship
    • Content Creator
    • Intervarsity UnGPTable Challenge (B2B Marketing)
    • Intervarsity UnGPTable Challenge (ESG)
    • Partner Programme
  • Fearless 20
  • Marketo
  • B2B Marketing
    ▼
    • Full Funnel Marketing
    • Lead Generation
  • Magazine
    ▼
    • MarTech
  • Contact