A "Duplicate values" error can occur when adding a picklist value to a field in Salesforce, even when the value does not appear to exist. This typically happens when the value was previously deleted from the field or when it exists as an inactive value in a sandbox — a known issue documented in the article "Error 'Duplicate Values' for a new, unique picklist value" (see Additional Resources).
This article provides step-by-step instructions for Salesforce Administrators or Developers to resolve this error by reactivating the picklist value using the Salesforce Metadata API.
Warning! The following steps use the Metadata API which has the capability to make potentially destructive and irreversible changes to your organization if not used properly. Test thoroughly in a sandbox before implementing in production. Salesforce Support cannot be held responsible for issues arising from improper Metadata API usage.
You will need access to one of the following Metadata deployment tools:
You also need to know your affected picklist field's API name. See "How to find the API name of a field" in Additional Resources if unsure.
Download the XML retrieve manifest file matching your field type:
To create your own, see Sample package.xml Manifest Files.
Open the downloaded XML file in a text editor (Notepad++ is recommended) and replace the placeholder values:
"EnterPicklistField'sAPINameHere" with your field's API name."EnterGlobalValueSet'sAPINameHere" with the Global Value Set's API name.Save the file (use Save, not Save As, to preserve the correct file extension).
After extracting the ZIP, navigate to the appropriate folder:
standardValueSets folder — look for a file ending in .standardValueSetobjects folder — look for a file named after the objectglobalValueSets folder — look for a file ending in .globalValueSetOpen the file in Notepad++ or a text editor.
Important: Only make the changes outlined below. Any other changes may cause unexpected or irreversible issues with your field's metadata.
Locate the inactive picklist value and update its <isActive> tag to true. If the value is absent, add it using the appropriate XML template for your field type:
For standard picklist fields, add after <sorted>false</sorted> and before </StandardValueSet>:
<standardValue>
<fullName>Affected Picklist Value</fullName>
<default>false</default>
<isActive>true</isActive>
<label>Affected Picklist Value</label>
</standardValue>
For custom picklist fields, add inside <valueSetDefinition>:
<value>
<fullName>Affected Picklist Value</fullName>
<default>false</default>
<isActive>true</isActive>
<label>Affected Picklist Value</label>
</value>
Note on Special Characters: If your picklist value contains special characters, replace them with HTML character codes before adding to XML:
| Special Character | Replace With |
| & | & |
| < | < |
| > | |
| " | " |
| ' | ' |
For example, the value Aerospace & Defense must be written as Aerospace & Defense in the XML. Failure to encode special characters will produce parse errors such as: Error parsing file: The entity name must immediately follow the '&' in the entity reference.
000382802
0 KB
0 KB
0 KB

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.