-1

I am trying to update a text field 'Nationality Code' from process builder using this formula

CASE([Account].Nationality__c ,
'United Arab Emirates', 'AE',
'Afghanistan', 'AF',
'Albania', 'AL',
'Algeria', 'DZ',
'Andorra', 'AD',
'Angola', 'AO',
'Antigua and Barbuda', 'AG',
'Argentina', 'AR',
'Armenia', 'AM',
'Australia', 'AU',
'Austria', 'AT',
'Azerbaijan', 'AZ',
'Bahamas', 'BS',
'Bahrain', 'BH',
'Bangladesh', 'BD',
'Barbados', 'BB',
'Belarus', 'BY',
'Belgium', 'BE',
'Belize', 'BZ',
'Benin', 'BJ',
'Bhutan', 'BT',
'Bolivia', 'BO',
'Bosnia and Herzegovina', 'BA',
'Botswana', 'BW',
'Brazil', 'BR',
'Brunei', 'BN',
'Bulgaria', 'BG',
'Burkina Faso', 'BF',
'Burundi', 'BI',
'Côte d'Ivoire', 'CI',
'Cabo Verde', 'CV',
'Cambodia', 'KH',
'Cameroon', 'CM',
'Canada', 'CA',
'Central African Republic', 'CF',
'Chad', 'TD',
'Chile', 'CL',
'China', 'CN',
'Colombia', 'CO',
'Comoros', 'KM',
'Congo (Congo-Brazzaville)', 'CG',
'Costa Rica', 'CR',
'Croatia', 'HR',
'Cuba', 'CU',
'Cyprus', 'CY',
'Czechia (Czech Republic)', 'CZ',
'Democratic Republic of the Congo', 'CD',
'Denmark', 'DK',
'Djibouti', 'DJ',
'Dominica', 'DM',
'Dominican Republic', 'DO',
'Ecuador', 'EC',
'Egypt', 'EG',
'El Salvador', 'SV',
'Equatorial Guinea', 'GQ',
'Eritrea', 'ER',
'Estonia', 'EE',
'Eswatini (fmr. "Swaziland")', 'SZ',
'Ethiopia', 'ET',
'Fiji', 'FJ',
'Finland', 'FI',
'France', 'FR',
'Gabon', 'GA',
'Gambia', 'GM',
'Georgia', 'GE',
'Germany', 'DE',
'Ghana', 'GH',
'Greece', 'GR',
'Grenada', 'GD',
'Guatemala', 'GT',
'Guinea', 'GN',
'Guinea-Bissau', 'GW',
'Guyana', 'GY',
'Haiti', 'HT',
'Holy See', 'VA',
'Honduras', 'HN',
'Hungary', 'HU',
'Iceland', 'IS',
'India', 'IN',
'Indonesia', 'ID',
'Iran', 'IR',
'Iraq', 'IQ',
'Ireland', 'IE',
'Israel', 'IL',
'Italy', 'IT',
'Jamaica', 'JM',
'Japan', 'JP',
'Jordan', 'JO',
'Kazakhstan', 'KZ',
'Kenya', 'KE',
'Kiribati', 'KI',
'Kuwait', 'KW',
'Kyrgyzstan', 'KG',
'Laos', 'LA',
'Latvia', 'LV',
'Lebanon', 'LB',
'Lesotho', 'LS',
'Liberia', 'LR',
'Libya', 'LY',
'Liechtenstein', 'LI',
'Lithuania', 'LT',
'Luxembourg', 'LU',
'Madagascar', 'MG',
'Malawi', 'MW',
'Malaysia', 'MY',
'Maldives', 'MV',
'Mali', 'ML',
'Malta', 'MT',
'Marshall Islands', 'MH',
'Mauritania', 'MR',
'Mauritius', 'MU',
'Mexico', 'MX',
'Micronesia', 'FM',
'Moldova', 'MD',
'Monaco', 'MC',
'Mongolia', 'MN',
'Montenegro', 'ME',
'Morocco', 'MA',
'Mozambique', 'MZ',
'Myanmar (formerly Burma)', 'MM',
'Namibia', 'NA',
'Nauru', 'NR',
'Nepal', 'NP',
'Netherlands', 'NL',
'New Zealand', 'NZ',
'Nicaragua', 'NI',
'Niger', 'NE',
'Nigeria', 'NG',
'North Korea', 'KP',
'North Macedonia', 'MK',
'Norway', 'NO',
'Oman', 'OM',
'Pakistan', 'PK',
'Palau', 'PW',
'Palestine State', 'PS',
'Panama', 'PA',
'Papua New Guinea', 'PG',
'Paraguay', 'PY',
'Peru', 'PE',
'Philippines', 'PH',
'Poland', 'PL',
'Portugal', 'PT',
'Qatar', 'QA',
'Romania', 'RO',
'Russia', 'RU',
'Rwanda', 'RW',
'Saint Kitts and Nevis', 'KN',
'Saint Lucia', 'LC',
'Saint Vincent and the Grenadines', 'VC',
'Samoa', 'WS',
'San Marino', 'SM',
'Sao Tome and Principe', 'ST',
'Saudi Arabia', 'SA',
'Senegal', 'SN',
'Serbia', 'RS',
'Seychelles', 'SC',
'Sierra Leone', 'SL',
'Singapore', 'SG',
'Slovakia', 'SK',
'Slovenia', 'SI',
'Solomon Islands', 'SB',
'Somalia', 'SO',
'South Africa', 'ZA',
'South Korea', 'KR',
'South Sudan', 'SS',
'Spain', 'ES',
'Sri Lanka', 'LK',
'Sudan', 'SD',
'Suriname', 'SR',
'Sweden', 'SE',
'Switzerland', 'CH',
'Syria', 'SY',
'Tajikistan', 'TJ',
'Tanzania', 'TZ',
'Thailand', 'TH',
'Timor-Leste', 'TL',
'Togo', 'TG',
'Tonga', 'TO',
'Trinidad and Tobago', 'TT',
'Tunisia', 'TN',
'Turkey', 'TR',
'Turkmenistan', 'TM',
'Tuvalu', 'TV',
'Uganda', 'UG',
'Ukraine', 'UA',
'United Kingdom', 'GB',
'United States of America', 'US',
'Uruguay', 'UY',
'Uzbekistan', 'UZ',
'Vanuatu', 'VU',
'Venezuela', 'VE',
'Vietnam', 'VN',
'Yemen', 'YE',
'Zambia', 'ZM',
'Zimbabwe', 'ZW',
'British', 'IO',
,'0')

Is there any mistake in this case statement? Please help..Thanks in advance!!!

1 Answer 1

0
  1. It appears that you have an extra comma at the end
    'British', 'IO',
    ,'0')
    ^
    

  1. Remove the square brackets [] from [Account].

  1. You need to escape the single quote in this line:
    'Côte d'Ivoire', 'CI',
           ^
    
    Try adding a backslash: \' (I can't recall if that is correct for escaping in a formula field...)
4
  • No..I tried removing that.That is not the problem Sep 24, 2022 at 13:46
  • Tried, but still the same issue Sep 24, 2022 at 14:07
  • When I copied/pasted your formula into a sandbox, those are the three things that it griped about when I clicked "Check Syntax." After that, the only thing it complained about was that Nationality__c does not exist! :) After replacing it with field name that is valid for this sandbox, I got the "all clear."
    – Moonpie
    Sep 24, 2022 at 14:12
  • OK, technically there was a fourth complaint (actually it was the very first complaint) - that the formula was 43 characters too long.
    – Moonpie
    Sep 24, 2022 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.