IsPhoneNumber
→ booleanBare-name Core form of Platform.Function.IsPhoneNumber — checks whether a string is a valid phone number. Requires Platform.Load.
Syntax
IsPhoneNumber(value)
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 0–9 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.
The official docs describe generic “valid phone number” validation, but the runtime enforces a stricter format: digits 0-9 only, no spaces, and no leading 0 — country codes must be written without the leading 00/+ (this is the same format SFMC phone fields and the SMS service expect).
Example
Platform.Load("core", "1.1.5");
if (IsPhoneNumber(phoneInput)) {
Write("Valid phone");
}