Loading

Data Import Errors in Salesforce Orgs with State and Country/Territory Picklists Enabled

Publiceringsdatum: Jul 5, 2026
Beskrivning


Importing new records or updating existing records may result in data validation errors when the State and Country/Territory Picklist (S&CP) feature is enabled in your Salesforce org, if the address data in your file does not match the predefined state and country values. For more details on how to get started, set, and configure State and Country/Territory Picklist values, see Let Users Select State and Country from Picklists.

You may encounter the following errors when performing a data manipulation operation (an import, insert, update, or upsert) when S&CP is enabled:

  • 'The [BillingStateCode / ShippingStateCode] field contains [ShippingStateCodeHere], which isn't an available state. Your administrator can add it for you.'
  • 'A country must be specified before specifying a state value for field'
  • 'There's a problem with this state, even though it may appear correct. Please select a state from the list of valid states.: [Billing / Shipping] State/Province'
  • 'There's a problem with this country, even though it may appear correct. Please select a country from the list of valid countries.: [Billing / Shipping] Country'

Lösning


Best Practices to Avoid Import Errors with State and Country/Territory Picklists (S&CP)

Use the following best practices to prevent receiving the above errors on import when using S&CP:

  • Set the Default Country to --None-- in your State and Country/Territory Picklist (S&CPL) setup section. This is not required but helps ensure that a default country selection does not influence the outcome of your data operation. See Configure State and Country Picklists for details.

  • Map both Standard State and Country fields together ('BillingState', 'ShippingState' & 'BillingCountry', 'ShippingCountry') OR both the 'StateCode' and 'CountryCode' fields together ('BillingStateCode', 'ShippingStateCode' & 'BillingCountryCode', 'ShippingCountryCode'). An import that maps standard fields ('BillingCountry') in conjunction with address code (ISO) fields ('ShippingStateCode') may result in an error.

  • If using Data Loader or another API tool and mapping to the standard address fields ('BillingState', 'ShippingState' & 'BillingCountry', 'ShippingCountry'), set the S&CPL integration values in your file. Integration values, by default, match the State/Country full names. For more details, see Edit State and Country Details.

  • If your file contains Country and State ISO Codes, ensure you are mapping to the address code fields ('BillingStateCode', 'ShippingStateCode' & 'BillingCountryCode', 'ShippingCountryCode') in Salesforce.

  • For countries where you have not defined any States, update the State fields with a null value to clear them. In Data Loader, check "Insert null values" under Settings.

Causes and Explanations for Common Errors

Error: 'The [BillingStateCode / ShippingStateCode] field contains [value], which isn't an available state'

This error may occur when mapping standard Country fields together with 'StateCode' fields, and the country set for a record in your file is not currently set as the Default Country in S&CPL setup. Salesforce attempts to set CountryCode field values to the country set as the default country. This behavior in conjunction with mapping only the standard Country address fields with State address code fields results in a mismatch between the StateCode value in your file and the default CountryCode values being set on the record.

If you are mapping StateCode address fields and either no default country is set, or the country values in your import file do not match the default country in S&CPL setup, you must include and map the CountryCode fields to override the application setting the record's country fields to the default country.

Error: 'A country must be specified before specifying a state value for field'

This error occurs when no default country is selected in S&CPL setup and users map the standard Country field and StateCode field together.

Error: 'There's a problem with this state / country, even though it may appear correct'

This error occurs when mapping to standard State and Country fields and records in your import file do not have a correct or corresponding state or country value. The value may be incorrect because the state does not exist for the specified country, or the values do not match the Integration Value set in S&CPL setup.

If the state value is confirmed correct and the record does not share the default country selected in S&CPL setup, the error may occur when users have mapped State fields without mapping Country fields.

Additional Considerations and Field Mapping Behaviors

  • Mapping 'CountryCode' with standard 'State' field is successful
  • Mapping 'CountryCode' with 'StateCode' is successful
  • Mapping 'StateCode' with standard 'Country' fields fails if the country associated with your file's State value is not set as the default country
  • Mapping the standard 'State' field without the standard 'Country' field fails if the state belongs to a country outside of the states listed in the default country set in S&CPL setup
  • State and Country picklist labels do not show in Salesforce1 when editing and creating records

Note: If integration values are the same as the ISO code values or differ from the State/Country full names, this indicates they have been updated either through the user interface via Setup or potentially through the Metadata API prior to enabling the feature. Disabling and re-enabling the feature will not change the state/country integration values. Support does not have the ability to reset integration values back to default or track who made changes to the State and Country Picklist setup.

Knowledge-artikelnummer

000387500

 
Laddar
Salesforce Help | Article