Have you ever wondered what is State and Country/Territory Picklists in Salesforce? If you are not sure what it is and curious about it, please read on! It will save your day 😉


State and Country/Territory Picklists

State and Country/Territory Picklists is a feature provided by Salesforce which allows you to choose the State and Country from picklists instead of manually typing it out.

state-and-country-territory-picklist

ALERT | Once the feature is turned on, you will also lose the address autocompletion feature!

Enable State and Country/Territory Picklists

Before you can enable this feature, you need to do the following steps:

1. Configure state and country/territory picklists

By default, Salesforce has prepared a whole list of countries for you. You can also set the Default Country/Territory here:

state-and-country-territory-picklist-configure-step-1

You can also add new Country/Territory like below:

state-and-country-territory-picklist-configure-add-new-country-step-1

Once your Country is added, you can add new State into it:

state-and-country-territory-picklist-configure-add-new-state-step-1

You can always come back to edit the Country or State here.

2. Scan your org for state and country/territory data

state-and-country-territory-picklist-scan-step-2

You will be receiving two emails from Salesforce when the scans are completed.

salesforce-scan-completed

3. Map and convert your data

You can choose which value to map with which Country and save to the change list.

state-and-country-territory-picklist-convert-country-step-3

Once you have done mapping the Country, you can click Next to map State.
state-and-country-territory-picklist-convert-state-step-3

When everything is all set, you can click Finish or Finish and Enable Picklists. Please bear in mind that once the feature is enabled, you will have to say bye-bye to your beloved address autocompletion feature. However, you can disable the feature if you need.

state-and-country-territory-picklist-convert-finish-step-3


Modify Picklists

Now, you should be able to see your address field become like this:

state-and-country-territory-picklist-select-value

If you would like the State to display in abbreviation (ex: Arizona -> AZ), you can navigate to Setup > State and Country/Territory Picklists and click on Configure states and countries. You can then click edit on United States and edit the State value like this:

state-and-country-territory-picklist-set-state-value

Once you have done that, you should be able to see the State in abbreviation:

state-and-country-territory-picklist-edit-state-value

NOTE | When you modify the State value, you see can see the value displayed is updated, but if you query the field, the value will still display the previous value until you save the record (with or without modification).


Once you enabled this feature, you cannot update the State or Country field to a non-defined value. For example, you will be getting an exception for updating the value to a non-defined value:

state-and-country-territory-picklist-modify-value-by-api


Well, that's all about it. Thanks for reading!

Post was published on , last updated on .

Like the content? Support the author by paypal.me!