Skip to content

Instantly share code, notes, and snippets.

@W3BGUY
Last active November 17, 2016 14:20
Show Gist options
  • Save W3BGUY/b9b3c3ded22718fbb2574745055eea53 to your computer and use it in GitHub Desktop.
Save W3BGUY/b9b3c3ded22718fbb2574745055eea53 to your computer and use it in GitHub Desktop.
JitterBit Conversion for Country To Country Code in Salesforce
<trans>
thisState=case(
thisState=='Alabama','AL',
thisState=='Alaska','AK',
thisState=='Arizona','AZ',
thisState=='Arkansas','AR',
thisState=='California','CA',
thisState=='Colorado','CO',
thisState=='Connecticut','CT',
thisState=='Delaware','DE',
thisState=='Florida','FL',
thisState=='Georgia','GA',
thisState=='Hawaii','HI',
thisState=='Idaho','ID',
thisState=='Illinois','IL',
thisState=='Indiana','IN',
thisState=='Iowa','IA',
thisState=='Kansas','KS',
thisState=='Kentucky','KY',
thisState=='Louisiana','LA',
thisState=='Maine','ME',
thisState=='Maryland','MD',
thisState=='Massachusetts','MA',
thisState=='Michigan','MI',
thisState=='Minnesota','MN',
thisState=='Mississippi','MS',
thisState=='Missouri','MO',
thisState=='Montana','MT',
thisState=='Nebraska','NE',
thisState=='Nevada','NV',
thisState=='New Hampshire','NH',
thisState=='New Jersey','NJ',
thisState=='New Mexico','NM',
thisState=='New York','NY',
thisState=='North Carolina','NC',
thisState=='North Dakota','ND',
thisState=='Ohio','OH',
thisState=='Oklahoma','OK',
thisState=='Oregon','OR',
thisState=='Pennsylvania','PA',
thisState=='Rhode Island','RI',
thisState=='South Carolina','SC',
thisState=='South Dakota','SD',
thisState=='Tennessee','TN',
thisState=='Texas','TX',
thisState=='Utah','UT',
thisState=='Vermont','VT',
thisState=='Virginia','VA',
thisState=='Washington','WA',
thisState=='West Virginia','WV',
thisState=='Wisconsin','WI',
thisState=='Wyoming','WY',
//UK States
thisState=='Aberdeenshire','ABD',
thisState=='Angus','ANS',
thisState=='Argyll','ARL',
thisState=='Avon','AVN',
thisState=='Ayrshire','AYR',
thisState=='Banffshire','BAN',
thisState=='Bedfordshire','BDF',
thisState=='Berkshire','BRK',
thisState=='Berwickshire','BEW',
thisState=='Buckinghamshire','BKM',
thisState=='Caithness','CAI',
thisState=='Cambridgeshire','CAM',
thisState=='Cheshire','CHS',
thisState=='Clackmannanshire','CLK',
thisState=='Cleveland','CLV',
thisState=='Clwyd','CWD',
thisState=='Cornwall','CON',
thisState=='County Antrim','ANT',
thisState=='County Armagh','ARM',
thisState=='County Down','DOW',
thisState=='County Durham','DUR',
thisState=='County Fermanagh','FER',
thisState=='County Londonderry','LDY',
thisState=='County Tyrone','NIR',
thisState=='Cumbria','CMA',
thisState=='Derbyshire','DBY',
thisState=='Devon','DEV',
thisState=='Dorset','DOR',
thisState=='Dumfriesshire','DGY',
thisState=='Dunbartonshire','DNB',
thisState=='Dyfed','DFD',
thisState=='East Lothian','ELN',
thisState=='East Sussex','ESX',
thisState=='Essex','ESS',
thisState=='Fife','FIF',
thisState=='Gloucestershire','GLS',
thisState=='Greater London','GL',
thisState=='Gwent','GNT',
thisState=='Gwynedd','GWN',
thisState=='Hampshire','HAM',
thisState=='Herefordshire','HEF',
thisState=='Hertfordshire','HRT',
thisState=='Invernessshire','INV',
thisState=='Isle of Arran','IOA',
thisState=='Isle of Barra','IBA',
thisState=='Isle of Benbecula','IBE',
thisState=='Isle of Bute','IBU',
thisState=='Isle of Canna','ICA',
thisState=='Isle of Coll','ICO',
thisState=='Isle of Colonsay','IOC',
thisState=='Isle of Cumbrae','ICU',
thisState=='Isle of Eigg','IEI',
thisState=='Isle of Gigha','IGI',
thisState=='Isle of Harris','IHA',
thisState=='Isle of Iona','IOI',
thisState=='Isle of Islay','IIS',
thisState=='Isle of Jura','IOJ',
thisState=='Isle of Lewis','ILE',
thisState=='Isle of Mull','IMU',
thisState=='Isle of North Uist','INU',
thisState=='Isle of Rum','IRU',
thisState=='Isle of Scalpay','ISC',
thisState=='Isle of Skye','ISK',
thisState=='Isle of South Uist','ISU',
thisState=='Isle of Tiree','ITI',
thisState=='Isle of Wight','IWI',
thisState=='Kent','KEN',
thisState=='Kincardineshire','KCD',
thisState=='Kinrossshire','KRS',
thisState=='Kirkcudbrightshire','KKD',
thisState=='Lanarkshire','LKS',
thisState=='Lancashire','LAN',
thisState=='Leicestershire','LEC',
thisState=='Lincolnshire','LIN',
thisState=='Merseyside','MSY',
thisState=='Middlesex','MDX',
thisState=='Mid Glamorgan','MGM',
thisState=='Mid Lothian','MLN',
thisState=='Morayshire','MRY',
thisState=='Nairnshire','NAI',
thisState=='Norfolk','NFK',
thisState=='Northamptonshire','NTH',
thisState=='North Humberside','NHU',
thisState=='North Yorkshire','NYK',
thisState=='Nottinghamshire','NTT',
thisState=='Oxfordshire','OXF',
thisState=='Peeblesshire','PEE',
thisState=='Perthshire','PKN',
thisState=='Powys','POW',
thisState=='Renfrewshire','RFW',
thisState=='Rossshire','ROC',
thisState=='Roxburghshire','ROX',
thisState=='Selkirkshire','SEL',
thisState=='Shropshire','SAL',
thisState=='Somerset','SOM',
thisState=='South Glamorgan','VGL',
thisState=='South Humberside','SHU',
thisState=='South Yorkshire','SYK',
thisState=='Staffordshire','STS',
thisState=='Stirlingshire','STG',
thisState=='Suffolk','SFK',
thisState=='Surrey','SRY',
thisState=='Sutherland','SLD',
thisState=='Tyne and Wear','GAT',
thisState=='Warwickshire','WAR',
thisState=='West Glamorgan','WGM',
thisState=='West Lothian','WLN',
thisState=='West Midlands','WMD',
thisState=='West Sussex','WSX',
thisState=='West Yorkshire','WYK',
thisState=='Wigtownshire','WGS',
thisState=='Wiltshire','WIL',
thisState=='Worcestershire','WOR',
//Mexico States
thisState=='Aguascalientes','AG',
thisState=='Baja California','BC',
thisState=='Baja California Sur','BS',
thisState=='Campeche','CM',
thisState=='Chiapas','CS',
thisState=='Chihuahua','CH',
thisState=='Coahuila','CO',
thisState=='Colima','CL',
thisState=='Durango','DG',
thisState=='Federal District','DF',
thisState=='Guanajuato','GT',
thisState=='Guerrero','GR',
thisState=='Hidalgo','HG',
thisState=='Jalisco','JA',
thisState=='Mexico State','ME',
thisState=='Michoacán','MI',
thisState=='Morelos','MO',
thisState=='Nayarit','NA',
thisState=='Nuevo León','NL',
thisState=='Oaxaca','OA',
thisState=='Puebla','PB',
thisState=='Querétaro','QE',
thisState=='Quintana Roo','QR',
thisState=='San Luis Potosí','SL',
thisState=='Sinaloa','SI',
thisState=='Sonora','SO',
thisState=='Tabasco','TB',
thisState=='Tamaulipas','TM',
thisState=='Tlaxcala','TL',
thisState=='Veracruz','VE',
thisState=='Yucatán','YU',
thisState=='Zacatecas','ZA',
true,thisState
);
if(Length(thisState)>0 && thisState!=Null() && thisState!='',
thisState;,
Unmap();
);
</trans>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment