I’m helping a client using Salesforce integrate with their website.
Most of their customers are from the US or Canada, but we need to support all countries. So enabling State and Country picklists in Salesforce seemed like a no-brainer.
(Note: In case you don’t know Salesforce well, enabling this feature changes the fields “Country” and “State” from a text field to a picklist. The picklists are dependent, so the values in State depend on the value in Country).
Basically, enabling these picklists helps avoid data entry errors, both within Salesforce and externally. External systems “just” need to pass the ISO codes of the country and state instead of the text labels, which could be in multiple languages.
This all works fine until you want to add new states. Guess what is your ONLY choice?
If you guessed manually in Salesforce, you’re RIGHT! (where’s the rolling eyes emoji?!)
Yes, you can export all countries and states using Workbench.
Yes, you can edit existing countries and states using Workbench.
No, you cannot add new values, by any means other than typing them manually.
My client wanted to import about 5000 new states for hundreds of countries. After learning the above lesson the hard way, I proposed the following options:
- Have someone manually type the 5000 states into Salesforce. Since each entry takes about 8 seconds, that’s over 11 hours of work.
- Have the website send the state/province for the US and Canada only, and don’t send it for any other country.
- Create a custom text field in Salesforce to hold the state/province, and ignore the out-of-the-box state/province field.
- Disable state/country picklists in Salesforce which turns them back into text fields. The impact of this would need to be assessed and it opens up the possibility of data errors whenever typing addresses in Salesforce.
Which option would you choose and why?
The takeaway
Before using state and country picklists in Salesforce, be weary of its limitations. It may work well for simple scenarios, but may not be “good enough” for your needs.