Forum Discussion
If you can get the country code to name mapping into a JSON file, you can import that file into the pipeline as an expression library. Then, in a Mapper snap you can access the library to do the lookup.
So, first you would put the country mappings in a file called countryCodes.expr in SLFS. That file would contain a JSON object where the keys were the codes and the values were the name. It would look something like the following:
{
"CL": "Chile",
"CM": "Cameroon",
"CN": "China"
}
You can then use the following expression in the Mapper snap to do the lookup:
lib.countryCodes[$country_code]
In that expression, the lib variable is used to access expression libraries and countryCodes is the name of the library file to access. The [$country_code] part is used to lookup the code, like “CN”, in the object to get the country name.