Phone number validations

Last published at: May 30th, 2024
Delete

Learn how to set up Record Validation for validating phone numbers. If you're interested in how to use phone number validation, read our Usage Guide

For Phone number validation, Record Validation needs to know in which country the phone number is registered. If you enter a phone number without country code, RV checks the value in the Country field to determine the country to use for validation. You can set a default value for the Country field in the Record Validation Setup, or enter a Country value when creating or editing a record.

The standard configuration of Record Validation maps the Lead, Contact, and Account Object Phone fields to the designated Country field. For each Phone field, make sure that the Country field is mapped to the record field that contains the country that should be used for validating the phone number.

Delete

Phone numbers with country code

If you enter a phone number for validation including the country code, such as '+123456789' for a phone number in the United States, the phone number can be validated without needing a value in the Country field. If the Country field contains a country different from the country code of the phone number, the phone number is still validated as being correct if the number exists in the country that the country code refers to.

Adding Validation

To add a phone field to use with Record Validation, click Add Validation.


Phone Pick a phone field you want to use with Record Validation.
Country Map the Country field. The value of the Country field determines the validation.
Format

Decide in what phone format you want to standardize your phone value.

E.164 (Default) - +1234567890
International - +1 234-567-890
National - (123) 456-7890
RFC 3966 - tel:+1-234-567-890

Store phone type in
Pick a field where you want to store the phone type (optional).
Store status code field in
Pick a field where you want to store the validation status code (optional). See below for an explanation.
Store status message field in
Pick a field where you want to store the validation status message (optional). See below for an explanation.
Store date and time of validation in
Pick a field where you want to store the date and time of the most recent validation (optional). See below for an explanation.

Storing Validation Metadata

Phone Validation has some metadata that you can store and use later on. The metadata consists of a status code and status message that give more information about the validation of a phone number (e.g. "correct" or "incorrect"), as well as the date and time of the most recent validation.
See Status codes description‍ for a full list of all status codes and messages.

You can use this metadata for example in Duplicate Check Merge, to merge all groups that were validated before a certain date; or to show the phone validation status message directly on any object.

For each metadata field, select a custom text field to store the validation data in. If you do not have suitable text fields available, create new custom fields with data type 'Text' or 'Date/Time' to use here. For (Person) Accounts, Contacts and Leads, custom fields for status codes were created upon install (e.g. "RV Shipping Address Status Code").

Note that the validation will overwrite any earlier content of the text or date/time field. This also means that you need to use different fields for storing the status code and status message.

Delete

Do not use the "RV Record Status" (recordval__rv2Status__c) or "RV Validation Result" (recordval__rv2Validation__c) fields to store status codes or other metadata. These fields are used to make Record Validation work for (custom) objects. If status codes or other metadata are stored in these fields, Record Validation will not work anymore for that object.

Delete

How does Record Validation validate your Phone Number?

Record Validation analyses your (international) phone number value and parses, validates, and formats based on the Country field value or the phone number's country code. Format your phone number on the fly with each digit a user enters or validate after the value is entered. It returns a value that is a valid, formatted phone number.