
Managing accurate phone numbers in Customer Relationship Management (CRM) systems is a critical yet often overlooked challenge for businesses. Poorly formatted phone numbers—like missing country codes, placeholders, or regional variations—can disrupt marketing campaigns, hinder customer communication, and waste valuable resources. In this blog, we present three solutions to tackle this issue.
Solution 1 is a detailed, step-by-step guide for setting up a custom Google Sheets script powered by OpenAI’s GPT-3.5-turbo and Numverify, ideal for tech-savvy users seeking a cost-effective and flexible approach. For those who prefer no-code tools, we provide links to Solution 2, a Zapier workflow integrating Google Forms, Sheets, and Numverify for real-time phone number validation, and Solution 3, which focuses on CRM integrations with Zapier to streamline data validation for systems like Zoho, HubSpot, and Pipedrive. Whether you need hands-on control or easy-to-use automation, this guide will help you ensure accurate and actionable phone number data. Let’s dive in!
Table of Contents
The Problem with CRM Phone Numbers
CRM systems are vital for maintaining customer relationships, but they often face a major hurdle: inconsistent and poorly formatted phone numbers. When data is entered into a CRM, users often rely on their own habits and preferences, leading to a mishmash of formats, embedded text, and even placeholder values. This unstructured data can wreak havoc when it comes time to use the numbers for campaigns, outreach, or customer support.
Imagine a marketing team preparing an SMS campaign. They export phone numbers from the CRM, only to find entries like “Call me at 555-123-4567,” “(123) 456-7890,” or just “000-000-0000.” Suddenly, what should have been a straightforward task turns into hours of manual cleanup. Without a way to standardize and validate these numbers, businesses risk wasting resources on invalid or unreachable contacts.
Numverify helps users with no-code solutions for validating phone numbers. In this blog, we’ll explore the most common scenarios of poor phone number formatting in CRM systems and show you how to fix them using a simple, free tool: Google Sheets. Specifically, we’ll demonstrate how to create a custom Google Sheets script, eliminating the need for no-code solutions like Zapier.
Comparing Costs: OpenAI API vs. Zapier for Extracting Phone Numbers
If you’re a marketer or sales specialist, you know that having clean, validated phone numbers is key to effective outreach. On the Numverify blog, we’ve shared how to pair Numverify with Zapier for effortless phone number validation. But what if there’s a more budget-friendly option for large-scale tasks? Let’s compare the costs and benefits of using OpenAI’s API versus Zapier for extracting phone numbers, so you can make the right choice for your needs.
OpenAI API: Affordable for High Volumes
OpenAI’s GPT-3.5-turbo provides a highly affordable solution for extracting phone numbers directly from text. With costs as low as a fraction of a cent per request, processing 10,000 entries costs about $1. This makes it an excellent choice for businesses handling large data volumes. While it may require a small amount of coding—such as integrating with a Google Sheet—the savings can be significant, especially for repetitive or large-scale tasks.
Zapier: Simple and User-Friendly
Zapier is a fantastic option for those who value simplicity and ease of use. It allows you to set up workflows, or “Zaps,” without needing any technical expertise. However, the pricing structure of Zapier is based on tasks, with each step in a workflow counting as a task. For example, a workflow to extract a phone number, validate it, and log it may use multiple tasks per entry. As your data volume grows, these tasks add up quickly.
For small projects or teams working with limited datasets, Zapier’s plans—starting at $19/month—may offer enough capacity. But for high-volume operations, the costs can escalate sharply. Processing 10,000 phone numbers could easily require upgrades to higher-tier plans, significantly increasing expenses.
Which Solution Is Right for You?
- For simplicity and quick setup: Choose Zapier. It’s perfect for marketers and sales professionals who want to get started without technical hurdles.
- For cost efficiency at scale: Use OpenAI’s API. A small amount of initial setup in a Google Sheet can unlock major savings for large datasets.
With a simple Google Sheet script powered by OpenAI’s GPT-3.5-turbo and the Numverify API, you can automate phone number extraction and validation. This approach combines the best of both worlds: automation tailored to your needs and costs that remain manageable even as your data volume grows.
By choosing the right tool for your business, you can save money, streamline your workflow, and ensure your data is always ready for action.
Common Scenarios of Poor Phone Number Formatting
Here are the most common ways phone numbers end up in your CRM in less-than-ideal formats:
1. Casual Entries
Example Input:
John Doe: Call me at 555-123-4567
Users often enter phone numbers informally, embedding them within other text or providing additional notes. While the phone number might be valid, isolating it from the text is a tedious manual task.
Why It’s a Problem:
- Extracting the number manually takes time and increases the risk of errors.
- Extraneous information can lead to missed or incorrectly formatted numbers.
2. Parentheses and Mixed Formatting
Example Input:
Reach us at (123) 456-7890.
Different regions and user preferences mean phone numbers might include parentheses, dashes, or spaces in inconsistent ways. While these formats are common, they can confuse systems that expect a uniform structure.
Why It’s a Problem:
- Parsing inconsistently formatted numbers requires advanced tools.
- Uniformity is critical for downstream processes, especially in international campaigns.
3. Placeholder or Dummy Numbers
Example Input:
000-000-0000 or 12345
Problem:
Users may enter placeholders or incomplete numbers when valid information is unavailable. These numbers often get entered into CRM systems either intentionally as temporary data or by mistake.
Why It’s a Problem:
- Placeholder numbers dilute the quality of the data.
- Campaigns using these numbers waste resources on invalid entries.
- Placeholder numbers may slip through simple validation checks, leaving erroneous data in the system.
4. Missing Country Codes
Example Input:
5551234567
Problem:
Phone numbers entered without a country code are a frequent issue, particularly in international businesses. CRM systems may struggle to associate the number with a specific region or carrier, making it unusable for certain campaigns.
Why It’s a Problem:
- Numbers without country codes may fail in cross-border marketing efforts.
- Some validation tools require international formats for proper verification.
- Without context, these numbers can lead to failed SMS or call campaigns.
5. Embedded in Freeform Text
Example Input:
“Hi, please call me back at 987-654-3210 as soon as possible.”
Problem:
Numbers entered within freeform text fields, such as comments, notes, or descriptions, pose a unique challenge. While the number may be valid, extracting it becomes a complex task, particularly if there is more than one number in the text.
Why It’s a Problem:
- Freeform text often combines multiple data points, making automated extraction difficult.
- Manual extraction is time-consuming and prone to human error.
- Important numbers can be overlooked or misinterpreted.
6. Overloaded Fields
Example Input:
Jane Doe | Mobile: 123-456-7890 | Office: 987-654-3210
Problem:
In some CRM systems, users may cram multiple pieces of information, such as office and mobile numbers, into a single field. While the data is technically present, it becomes difficult to separate and use effectively.
Why It’s a Problem:
- Creates ambiguity during data parsing or validation.
- Leads to errors when attempting to use numbers for targeted campaigns.
- Reduces the effectiveness of automated tools designed for single-number fields.
7. Regional Formatting Variations
Example Input:
020 7946 0958 (UK) or +49 30 1234567 (Germany)
Problem:
Regional variations in phone number structures, such as spacing, prefixes, and length, add complexity to maintaining consistent formatting in CRM systems. While these variations may be valid, they often require normalization to meet system requirements.
Why It’s a Problem:
- Non-standard formatting may fail in systems expecting uniform inputs.
- Requires additional logic for handling regional differences.
- Inconsistent formatting makes validation across multiple regions more complicated.
Bad Numbers Hurt Your Strategy—Automation Saves It
Poorly formatted or invalid phone numbers in CRM systems can wreak havoc on your business operations, leading to inefficiencies and missed opportunities. Here’s how bad data undermines your strategy:
- Marketing Campaigns: Invalid phone numbers result in failed SMS deliveries and unanswered calls, limiting your campaign’s reach and wasting precious resources. This reduces the overall effectiveness of your marketing efforts.
- Customer Support: Inaccurate contact information delays assistance, frustrates customers, and risks damaging long-term relationships, ultimately impacting your brand’s reputation and customer retention.
- Operational Costs: Targeting invalid or nonexistent phone numbers wastes time and money, diverting resources away from more productive initiatives and driving up costs unnecessarily.
Bad numbers do more than just waste resources—they can derail your entire communication strategy. Automating the extraction and validation process not only saves time and effort but also ensures your data is clean, accurate, and actionable. With automation, you can improve accuracy, maintain a reliable contact database, and keep your business running efficiently.
Solution 1: Setting Up the Google Sheets Script
This is where automation shines. With a custom Google Sheets script powered by OpenAI’s GPT-3.5-turbo and the Numverify API, you can turn disorganized phone number data into a polished, ready-to-use format. Here’s how to do it step-by-step:
How the Script Works
This Google Sheets script addresses the two primary challenges of handling CRM phone number data:
1. Extracting Phone Numbers Using OpenAI’s GPT-3.5-turbo:
- OpenAI’s language model intelligently parses unstructured text to identify and extract phone numbers, even when they are embedded in freeform data or poorly formatted.
- The result is a clean, isolated phone number ready for validation.
2. Validating Phone Numbers with Numverify:
- The Numverify API verifies the extracted phone numbers, ensuring they are valid, active, and associated with the correct country or carrier.
- This step filters out unusable numbers, allowing you to focus on actionable data.
By combining these two processes into an automated workflow, the script not only saves time but also ensures data accuracy, improving the overall reliability of your CRM exports.
Setting Up the Google Sheets Script: Step-by-Step Guide
If you’re ready to clean and validate your CRM phone number data, this Google Sheets script will save you hours of manual work. Follow these steps to set up and start using the script:
Step 1: Open Google Sheets and Access Apps Script
1. Create or open a Google Sheet.
- If you have a file with CRM exports, open it in Google Sheets. If not, create a new spreadsheet to try out the script.
2. Go to Apps Script.
In the top menu, click Extensions > Apps Script. This will open the Apps Script editor in a new tab.
This is where you will paste and save the script that we will provide you with later.
Step 2: Obtain Your API Keys
The script requires two API keys: one for OpenAI (to extract phone numbers) and another for Numverify (to validate them).
1. Get Your OpenAI API Key:
- Visit OpenAI and create an account if you don’t already have one.
- Go to the API section in your account settings.
- Generate a new API key and copy it. Keep this key secure—you’ll need to paste it into the script.
2. Get Your Numverify API Key:
- Go to Numverify and sign up for a free or paid plan, depending on your needs. The free plan works for basic validation.
- Once registered, log in and navigate to the “API Access” section.
- Copy the provided API key. This key will also be used in the script.
Step 3: Add the Script to Your Google Sheet
1. Paste the Code:
- In the Apps Script editor, delete any existing code and paste the following:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
function EXTRACT_AND_VALIDATE_PHONE_NUMBER(text) { if (!text) return 'No input text'; var openaiApiKey = 'YOUR_OPENAI_API_KEY'; // Replace with your OpenAI API key var numverifyApiKey = 'YOUR_NUMVERIFY_API_KEY'; // Replace with your Numverify API key var phoneNumber = extractPhoneNumberUsingOpenAI(text, openaiApiKey); if (!phoneNumber) return 'No phone number found'; var validation = validatePhoneNumber(phoneNumber, numverifyApiKey); return phoneNumber + ' - ' + validation; } function extractPhoneNumberUsingOpenAI(text, apiKey) { var url = 'https://api.openai.com/v1/chat/completions'; var payload = { 'model': 'gpt-3.5-turbo', 'messages': [ { 'role': 'system', 'content': 'You are a helpful assistant.' }, { 'role': 'user', 'content': 'Extract the phone number from this text:\n\n' + text } ], 'max_tokens': 20, 'temperature': 0 }; var options = { 'method': 'post', 'contentType': 'application/json', 'headers': { 'Authorization': 'Bearer ' + apiKey }, 'payload': JSON.stringify(payload) }; try { var response = UrlFetchApp.fetch(url, options); var json = JSON.parse(response.getContentText()); return json.choices[0].message.content.trim(); } catch (e) { Logger.log('Error: ' + e); return null; } } function validatePhoneNumber(phoneNumber, apiKey) { var url = 'http://apilayer.net/api/validate?access_key=' + apiKey + '&number=' + encodeURIComponent(phoneNumber); try { var response = UrlFetchApp.fetch(url); var result = JSON.parse(response.getContentText()); return result.valid ? 'Valid' : 'Invalid'; } catch (e) { Logger.log('Error: ' + e); return 'Validation failed'; } } |
2. Replace the Placeholder Keys:
- Replace YOUR_OPENAI_API_KEY with your actual OpenAI API key.
- Replace YOUR_NUMVERIFY_API_KEY with your actual Numverify API key.
3. Save the Script:
Click the floppy disk icon or File > Save and name the script (e.g., “Phone Number Validation”).
Step 4: Use the Script in Your Spreadsheet
1. Enter the Function in a Cell:
In your Google Sheet, locate the column with your CRM data. For example, if phone numbers are in Column A, go to an adjacent column (e.g., Column B) and type:
=EXTRACT_AND_VALIDATE_PHONE_NUMBER(A1)
- Replace A1 with the cell reference containing the text you want to process.
2. Press Enter:
- The script will extract the phone number from the text in the referenced cell, validate it, and display the result (e.g., 555-123-4567 – Valid).
3. Drag the Formula Down:
- If you have multiple rows, drag the formula down to apply it to all rows in the column.
Step 5: Troubleshooting and Tips
- Ensure API Key Accuracy: Double-check that you’ve entered the correct API keys for OpenAI and Numverify.
- Check for API Limits: If you’re working with a large dataset, ensure your API plan supports the volume of requests.
- Logs for Errors: If the script doesn’t work as expected, go to Extensions > Apps Script > View > Logs to identify issues.
Why This Script is Powerful
Using Google Sheets for this task is free, accessible, and easy to set up. The integration of OpenAI and Numverify brings powerful automation to a widely-used tool, helping businesses clean up messy phone number data quickly and efficiently. Whether you’re preparing a marketing campaign or ensuring accurate customer records, this script transforms unstructured data into actionable insights with just a few clicks.
We demonstrated the script with a basic OpenAI prompt and Numverify validation, but you can customize it to suit more advanced use cases. For example, you could:
Extract multiple phone numbers: Modify the OpenAI prompt to locate all phone numbers within a block of text instead of just the first one.
Enhance data contextualization: Adjust the prompt to extract not only phone numbers but also associated names, locations, or tags to enrich your dataset.
- Standardize phone number formatting: Incorporate logic in the script to reformat all extracted numbers to a consistent structure (e.g., international format).
- Batch process multiple fields: Extend the script to process multiple columns or entries at once, accommodating more complex CRM exports.
This flexibility allows you to tailor the script for your unique data needs, whether you’re optimizing contact records, streamlining customer support workflows, or preparing for a global marketing campaign.
With its seamless integration of OpenAI’s natural language processing and Numverify’s accurate validation, this script ensures your CRM data is clean, reliable, and ready for use. Thank you for reading, and we hope this script inspires you to automate and enhance your data workflows!
Optimizing Phone Number Validation: Tailored Solutions for Every User
We’ve guided you through our script solution using Google Sheets, OpenAI, and Numverify—a cost-effective, customizable approach for tech-savvy users. However, for those who prefer no-code, user-friendly automation or need CRM-specific workflows, we present two additional options: Zapier workflows and CRM integrations.
Solution 1: Google Sheets Script
This solution, perfect for budget-conscious users with basic coding knowledge, allows you to automate phone number extraction and validation directly in Google Sheets using OpenAI’s GPT-3.5-turbo and Numverify API.
Why Choose This Solution?
- Cost-Effective: Minimal expenses, with OpenAI API calls costing fractions of a cent.
- Highly Customizable: Tailor the script for batch processing, data enrichment, or standardized formatting.
- Hands-On Control: Offers full transparency and flexibility for those comfortable with simple coding tasks.
We’ve provided a step-by-step guide to help you implement this powerful script.
For Users Who Prefer No-Code Automation
If scripting isn’t your forte, or you’re looking for seamless, ready-made solutions, we recommend the following two no-code options:
Solution 2: Automate Data Security with Zapier
Available on this blog post: Easy Steps to Automate Data Security by Verifying New Phone Prospects with Zapier
This solution connects Google Forms, Google Sheets, and Numverify via Zapier, automating phone number validation in real-time.
Why Choose This Solution?
- Ease of Use: No coding required. Zapier’s drag-and-drop interface simplifies automation.
- Secure and Compliant: GDPR and SOC 2 compliance ensures data safety.
- Real-Time Validation: Automates workflows, validating phone numbers as they’re added to Google Sheets.
This is ideal for marketers and sales specialists who want a quick, simple, and effective solution.
For Users Managing CRM Systems
Solution 3: Optimizing CRM Systems with Zapier and Numverify
Detailed in this guide optimizing CRM Systems for Phone Number Validation
For CRM users (HubSpot, Zoho, Pipedrive, etc.), this solution integrates Zapier, OpenAI, and Numverify to automate phone number validation directly from your CRM.
Why Choose This Solution?
- CRM Integration: Works with popular CRMs like Zoho and HubSpot for seamless validation.
- Advanced Automation: Formats phone numbers using OpenAI and validates them with Numverify, ensuring data accuracy.
- Centralized Logging: Logs validation results in Google Sheets for easy tracking and management.
This approach is perfect for businesses looking to optimize CRM workflows while maintaining high data accuracy and compliance.
Which Solution Fits Your Needs?
Tech-Savvy and Cost-Conscious: Try the Google Sheets Script for maximum flexibility and minimal cost.
- No-Code Simplicity: Use Zapier workflows for user-friendly, automated validation.
- CRM Optimization: Go for CRM integrations with Zapier, OpenAI, and Numverify to enhance CRM data management.
Each solution is tailored to meet specific needs, empowering you to improve your phone number validation processes, reduce errors, and enhance operational efficiency. Happy automating!
Q&A: Addressing Common Questions Across All Solutions
General Questions
Q: Why use OpenAI instead of regular expressions?
A: OpenAI’s GPT-3.5-turbo can intelligently parse unstructured and complex text to identify phone numbers, even when they don’t follow standard patterns or formats. This capability makes it superior to regular expressions for extracting data from messy or freeform text.
Q: What happens if the number is invalid?
A: The validation process—whether via the script or Zapier—will flag invalid numbers. In the Google Sheets Script, the result will include “Invalid,” allowing you to filter out problematic entries. Similarly, in Zapier workflows, invalid numbers can be highlighted in Google Sheets for easy identification.
Q: Can these solutions handle international phone numbers?
A: Yes, Numverify supports international phone number validation, provided the numbers include the correct country code. OpenAI, when used in conjunction with Numverify, can help reformat numbers into the proper international format.
Q: Are there API limits?
A: Both OpenAI and Numverify have usage limits based on your API plan. Ensure your chosen plan accommodates the volume of requests you need for your workflow. Numverify offers free and paid tiers, while OpenAI’s cost depends on the number of API calls.
Google Sheets Script Solution
Q: Do I need coding experience to use the Google Sheets Script?
A: Basic familiarity with Google Apps Script is helpful, but the provided step-by-step guide makes it accessible even for users with minimal coding experience.
Q: Can the script standardize phone number formats?
A: Yes, the script can be customized to reformat numbers into a consistent international format, ensuring uniformity across your dataset.
Q: How do I troubleshoot errors in the script?
A: Use the Apps Script debugger to identify issues. Common problems include incorrect API keys, exceeding API limits, or poorly formatted input data.
Q: Can I validate large datasets with this script?
A: Yes, but ensure your OpenAI and Numverify API plans can handle the number of requests. For very large datasets, you may need to batch your validation tasks.
Zapier Workflow Solution
Q: Why use Zapier instead of writing a custom script?
A: Zapier’s no-code platform is ideal for users who want simplicity and ease of use. It provides pre-built integrations with tools like Google Forms, Google Sheets, and Numverify, making automation accessible without requiring technical expertise.
Q: Can I modify the Zapier workflow?
A: Absolutely. You can customize the workflow to include additional steps, such as sending validation results to your CRM or notifying team members of invalid entries.
Q: How does Zapier handle security?
A: Zapier is SOC 2 Type II compliant and uses TLS encryption for data in transit and AES-256 encryption for data at rest, ensuring your data remains secure.
Q: Is there a free tier for Zapier?
A: Zapier offers a free tier with limited tasks and workflows. However, for workflows involving large volumes of data or advanced features, you may need a paid plan.
CRM Integration Solution
Q: Which CRMs are supported in the CRM integration solution?
A: Zapier supports popular CRMs like Zoho, HubSpot, Pipedrive, and others. You can use this workflow to validate phone numbers and log results in these systems.
Q: Can invalid numbers be flagged in the CRM?
A: While direct updates to CRM fields may depend on the system’s flexibility, a workaround is logging validation results in a Google Sheet linked to your CRM. Alerts can then be set for invalid numbers.
Q: Does this solution require extensive configuration?
A: While some setup is needed, such as linking your CRM to Zapier and configuring APIs, pre-built Zap templates simplify the process, minimizing manual work.
Q: How does OpenAI help with CRM data validation?
A: OpenAI can format phone numbers from CRM exports into a proper international structure, ensuring compatibility with Numverify for accurate validation.