0-CodeKit icon

0-CodeKit

A toolbox of no-code utilities

Overview

The Convert → Nation ISO Switch operation in the 0-CodeKit node allows you to convert between a country's full English name and its ISO-Alpha-3166 code (e.g., "Germany" ↔ "DE"). This is useful for workflows that require standardized country codes or need to display user-friendly country names based on ISO codes.

Common scenarios:

  • Standardizing user input of country names to ISO codes for API requests.
  • Converting ISO codes from external data sources into readable country names for reports or emails.

Practical examples:

  • Transforming "France" into "FR" before sending data to a payment gateway.
  • Displaying "United States" instead of "US" in a customer-facing email.

Properties

Name Meaning
Operation Selects the conversion direction:
- Nation to ISO
- ISO to Nation
Nation Value The full name of the nation in English (used when converting Nation to ISO)
ISO Value The ISO-Alpha-3166 code of the nation (e.g., DE) (used when converting ISO to Nation)

Output

The output will be a JSON object containing the result of the conversion. Depending on the selected operation, the structure typically includes:

  • For "Nation to ISO":
    {
      "iso": "DE"
    }
    
  • For "ISO to Nation":
    {
      "nation": "Germany"
    }
    

If an error occurs and "Continue On Fail" is enabled, the output may include:

{
  "error": "Error message"
}

Dependencies

  • External Service: Requires access to the CodeKit API.
  • n8n Credentials: You must configure the codeKitApi credential in n8n for authentication.

Troubleshooting

Common issues:

  • Invalid Country Name or ISO Code: If the provided value does not match a recognized country or code, the node may return an error or an empty result.
  • Missing Required Property: If you do not provide the required property for the selected operation (e.g., missing "Nation Value" when converting Nation to ISO), the node will throw an error.
  • Credential Issues: If the codeKitApi credential is not set up correctly, the node will fail to connect to the service.

Error messages:

  • "Cannot find nation/ISO code": Double-check your input for typos or incorrect values.
  • "Missing required parameter": Ensure all required fields are filled based on your chosen operation.
  • "Authentication failed": Verify your CodeKit API credentials in n8n.

Links and References

Discussion