Skip to content

Instantly share code, notes, and snippets.

@tsabbay
tsabbay / dumpCountriesAndStatesCsv.js
Created January 11, 2023 19:38 — forked from mchang-r7/dumpCountriesAndStatesCsv.js
Export state and country picklists as CSV files from Salesforce by using the Chrome Developer Console to parse the XML in Address.settings
// Step 1, store the XML in a string
// Replace the string with the actual, full XML content copied as-is
// from Address.settings
var xml = '...';
// Step 2, parse the XML
// See https://www.w3schools.com/xml/xml_parser.asp
var parser = new DOMParser();
var xmlDoc = parser.parseFromString(xml, "text/xml");