Actions4
Format
AI-generatedSummary
Format a given phone number string into a selected format using libphonenumber-js, with optional default country code for numbers missing an international prefix.
Inputs
- Phone Number (required) — The phone number to format. Should include the international prefix (e.g. +40) or specify a Default Country if missing.
- Default Country — ISO 3166-1 alpha-2 country code used when the phone number lacks an international prefix; leave empty if numbers always include +XX.
- Format (required) — Choose the output format: E.164, International, National, or RFC3966.
- Options: Continue On Invalid — If true, the node returns an item with isValid=false instead of throwing an error when the input number cannot be parsed.
Output shape
a list of JSON objects, each corresponding to an input item
Each output JSON includes the original input, isValid flag, the formatted phone number under 'formatted', and the format used. If parsing fails and 'Continue On Invalid' is false, the node throws an error. If true, it returns an item with isValid=false and an error message.