Syntax

IsPhoneNumber(value)
1 argument

Parameters

Name Type Required Description
value string Yes The string to evaluate as a phone number.

Description

IsPhoneNumber() is the bare-name Core-library form of Platform.Function.IsPhoneNumber(). It requires Platform.Load("core", "1.1.5") before use — the bare name is undefined until the load has run.

It behaves identically to Platform.Function.IsPhoneNumber(): same argument, same boolean return. Use the qualified Platform.Function.IsPhoneNumber() form when you do not already have a Platform.Load call in scope.

Return value

Returns a boolean. The accepted format is digits 09 only, no spaces, and no leading 0. Country codes must be written without the leading 00/+. This is the same digits-only, no-leading-zero format that SFMC phone-number fields and the SMS (MobileConnect) service expect. Strings containing spaces, a leading 0, a +/00 prefix, letters, mixed text, or that are empty all return false. See the qualified Platform.Function.IsPhoneNumber page for the full runtime format details.

Example

Platform.Load("core", "1.1.5");
if (IsPhoneNumber(phoneInput)) {
    Write("Valid phone");
}

See Also