ISO3166
Overview
Use the ISO3166 transform to convert an incoming string into an ISO 3166 country code value. The incoming data must be either a recognized country name or country code:
- The alpha2 country code (e.g. "ES")
- The alpha3 country code (e.g. "ESP)
- The numeric country code (e.g. 724)
- The English name for the country (e.g. Spain)
- The native name for the country (e.g. España)
The output value can be any of these three values:
- Two-character country code (e.g., "US")
- Three-character country code (e.g., "USA")
- Numeric country code (e.g., "840")
If the input string to the transform does not represent a valid country code or country name, the transform returns null.
Transform Structure
The transform for iso3166 only requires the transform's type and name attributes:
{
"type": "iso3166",
"name": "ISO3166 Transform"
}
Top-level properties (required)
-
type
string(required)
Must be set toiso3166. -
name
string(required)
The name of the transform as it will appear in the UI's dropdown menus. -
requiresPeriodicRefresh
boolean(optional)
Whether the transform logic should be reevaluated every evening as part of the identity refresh process. Default isfalse.
Attributes
The ISO3166 transform uses the following structure:
{
"type": "iso3166",
"name": "Transform Name",
"attributes": {
"format": "alpha2"
}
}
attributes (optional)
The attributes object contains the format configuration.
Optional
-
format
string(optional)
The ISO 3166 format to return:alpha2- Two-character country code (e.g., "US") - Defaultalpha3- Three-character country code (e.g., "USA")numeric- Numeric country code (e.g., "840")
-
input
object(optional)
Explicitly defines the input data passed into the transform. If not provided, the transform uses input from the source and attribute combination configured in the UI.
Examples
Because no specific format is provided, this transform defaults to the alpha2 output and returns "US".
Input: "United States of America"
Output: "US"
Transform request body:
{
"type": "iso3166",
"name": "ISO3166 Transform"
}
Because the desired format is specified as numeric, the output of this transform returns "724".
Input: "ES"
Output: "724"
Transform request body:
{
"attributes": {
"format": "numeric"
},
"type": "iso3166",
"name": "ISO3166 Transform"
}