Actions9
Detect Country
AI-generatedOverview
This node provides multiple utility actions, including detecting the country from a phone number. The 'Detect Country' operation takes a phone number with a country code as input, cleans and normalizes it, then matches the country code against a predefined list of countries primarily from the Middle East and North Africa region. It outputs detailed information about the detected country, such as its Arabic and English names, country code, flag emoji, and validation status of the phone number length. This operation is useful for workflows that need to identify the origin country of phone numbers for regional processing, validation, or routing purposes.
Use Case Examples
- Validating and categorizing customer phone numbers by country in a CRM system.
- Routing support calls based on the caller's country detected from their phone number.
- Filtering or tagging contacts in marketing automation based on their country code.
Properties
| Name | Meaning |
|---|---|
| Phone Number | The phone number with country code to detect the country from. It is required and should include the country dialing code, e.g., +966501234567 or 00966501234567. |
Output
JSON
success- Indicates if the operation was successful.operation- The operation performed, here it is 'detectCountry'.country_detected- Boolean indicating if the country was successfully detected.country_name_ar- The detected country's name in Arabic.country_name_en- The detected country's name in English.country_code- The ISO country code of the detected country.country_flag- Emoji flag representing the detected country.phone_code- The phone country code extracted from the number.original_number- The original phone number input by the user.cleaned_number- The phone number after removing spaces, dashes, parentheses, and Arabic numerals converted to Latin digits.formatted_number- The cleaned phone number formatted with a leading '+' sign.is_valid- Boolean indicating if the phone number length matches the expected length for the detected country.validation_message- Message describing the validation status of the phone number length.expected_length- The expected length of the phone number for the detected country.actual_length- The actual length of the cleaned phone number.message- Additional message if the country could not be detected.
Troubleshooting
- Ensure the phone number includes a valid country code starting with '+' or '00'.
- The node only recognizes a predefined set of country codes mainly from Middle East and North Africa; numbers from other countries may not be detected.
- Phone numbers must be correctly formatted without invalid characters; spaces, dashes, and parentheses are removed automatically.
- If the phone number length does not match the expected length for the detected country, the validation will fail with a message indicating the mismatch.
Links
- List of country calling codes - Reference for country dialing codes used in phone numbers.