View Categories

Metadata State Country

1 min read

State and Country/Territory picklist Metadata #

ss_MetaRegion extracts the organisation’s configured State and Country/Territory picklists using the Salesforce Metadata API, returning the full definition of countries and states, including inactive values, visibility settings, default flags, and the hierarchical relationship between countries and their associated states.

This provides a complete, view of geographic configuration within the org, making it particularly useful for data standardisation, validation, and replication scenarios where understanding the full set of allowed (and disallowed) region values is required.

Results are loaded to table ss_SysRegion

Parameters #

ParameterPurpose
@EnvSQL Sales Environment Name, see Setup
@Special1Future use, not currently used
@Special2Future use, not currently used

Example of Use #

exec ss_MetaRegion 'UAT'

SQL-SALES ss_SysRegion run date: 2026-04-09 ———————-

20:59:47: v26.2.0.1 Copyright c 2026 SQL-Sales Ltd

20:59:47: Using Env|Schema: uat|dbo

20:59:47: Starting ss_SysRegion retrieval

20:59:49: Connection with Username/Password/ST (BULK & REST API)

20:59:49: Drop existing ss_SysRegion if exists and recreate

20:59:51: Load to dbo.ss_SysRegion

—————————————————————–

ss_SysRegion table #

Column NamePurpose
CountryISOCodeThe ISO code for the country, used internally and for integrations
CountryLabelThe display name of the country as shown to users
CountryIntegrationValueThe integration value used when mapping external data to Salesforce
CountryActiveIndicates whether the country is enabled for use in the org
CountryVisibleIndicates whether the country is visible/selectable in the UI
CountryOrgDefaultIndicates whether this is the default country for the org
CountryStandardIndicates whether the country is a standard Salesforce-provided value or a custom addition
StateISOCodeThe ISO code for the state/region, used internally and for integrations
StateLabelThe display name of the state/region as shown to users
StateIntegrationValueThe integration value used when mapping external data to Salesforce
StateActiveIndicates whether the state/region is enabled for use
StateVisibleIndicates whether the state/region is visible/selectable in the UI
StateStandardIndicates whether the state/region is a standard Salesforce-provided value or a custom addition

Leave a comment

Your email address will not be published. Required fields are marked *