Skip to main content

If you need/want to extract all your countries and states here's what I found works.  It's human readable, but another format would be needed if you wanted to do something with it programatically.  If anyone has thoughts on making the output better please share.

 

  1. Create a package.xml file somewhere (contents will be pasted below)
  2. Open workbench
  3. go to Migration>Retrieve
  4. Open the package.xlm you created
  5. Click next
  6. When done it gives you a zip file
  7. Extract the address.settings file
  8. Open in notepad++
  9. Copy all
  10. Paste to this online converter
    1. http://www.convertcsv.com/xml-to-csv.htm
  11. leave the options as-is
    1. Enter countriesAndStates as the starting node
  12. Save to csv

 

Package.xml is like this:

<?xml version="1.0" encoding="UTF-8"?>

<Package xmlns="http://soap.sforce.com/2006/04/metadata">

    <types>

        <members>Address</members>

        <name>Settings</name>

    </types>

    <version>45.0</version>

</Package>

 

@* Salesforce Administrators * @Admin Group, Raleigh, US @Solo Admins 

2 Kommentare
  1. 27. Aug. 2019, 13:42
    Awesome, thanks @David Roberts

    !

    That way does indeed dump out all the country and state codes, but it doesn't associate the states and countries or tell you if they are active like my original post.

    So depending on your needs, we now have two different methods.

0/9000