I changed some integration values from the country / state pick list: State and Country Configuration

When I try to insert a record by integration, I get the error: "The ShippingStateCode field contains 21, which is not an available state. Your administrator can add it for you".

I created a record by UI and after save, I checked the field where StateCode is different from State. Is this the expected behavior? Record created on UI

I review the question but it wasn't helpful for me. If I understand correctly, when I change the integration value, I can use the new value to integrate the records, right? So, what is wrong?

2 Answers 2


Integration Value is different from the State Code.

State Name and Integration Value both are the same and both refer to the State field.

  1. State Name: The value in the Name field displays to users who interact with your picklist.
  2. Integration Value: The value in the integration field is used in Apex, SOQL, etc.

Please refer to this: https://help.salesforce.com/articleView?id=admin_state_country_picklists_integ_values.htm&type=5

"The ShippingStateCode field contains 21, which is not an available state. Your administrator can add it for you" to resolve this error you need to create a new State with Sate Code as '21'. Since Salesforce does not allow to edit state codes for existing ones.

  • About the document The integration value is used by: [...] API queries and integrations [..] does not refer to creating / changing a record via API using the integration value? Thanks! Nov 20, 2020 at 16:25
  • Integration Value is also used via API to populate the state field. Nov 21, 2020 at 1:04

Integration Values are meant to solve this problem:

"I want to enable state and country picklists in an existing org, but I have an API integration that updates data using the full names of states and countries in the text-type State and Country fields, and I don't have time to update the integration to use the StateCode and CountryCode fields instead. I need a way to tell Salesforce that when I use 'California' in the State field, I really want it to put "CA" in the StateCode field."

So Integration Values are only meant to be used in the text-type State and Country fields, whereas the code values are meant to be used in the picklist-type StateCode and CountryCode fields. It's a way to associate a long-form name with the picklist value, even when it doesn't match the code.

So in your example, you can either put '21' in the ShippingState field, or put 'PB' in the ShippingStateCode field, but not vice versa.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.