# VALIDATION\_ERROR' 'PropertyValidationError.NON\_UNIQUE\_OPTION\_LABELS'

**URL:** <https://community.hubspot.com/t/validation-error-propertyvalidationerror-non-unique-option-labels/81837>\
**Category:** APIs & Integrations\
**Tags:** companies, workflows, professional, contacts\
**Created:** [May 23, 2023, 8:14pm UTC](https://community.hubspot.com/t/validation-error-propertyvalidationerror-non-unique-option-labels/81837 "2023-05-23T20:14:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![psl86](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/psl86/32/82797_2.png) [@psl86](https://community.hubspot.com/u/psl86)\
**Post date:** [May 23, 2023, 8:14pm UTC](https://community.hubspot.com/t/validation-error-propertyvalidationerror-non-unique-option-labels/81837/1 "2023-05-23T20:14:52Z")

</div>

Hi!  
I get the following error when trying to update a dropdown custom property on contact and customer via the API:

```lia-code-sample
 body: {
 status: 'error',
 message: "Property option labels must be unique. For the property 'X' of object type 'Y' these labels are duplicated: Z",
 correlationId: 'dcc084f8-cb3f-4a7b-9704-67e00a1f54b0',
 context: [Object],
 category: 'VALIDATION_ERROR',
 subCategory: 'PropertyValidationError.NON_UNIQUE_OPTION_LABELS'
 },

```

Z has been a part of the dropdown X before, but was removed some time ago. I’m now trying to add it back without any luck. It works for elements that haven’t been in the list before.

The javascript for the custom code:

```lia-code-sample
 const hubspot = require('@hubspot/api-client');
 const hubspotClient = new hubspot.Client({
 accessToken: process.env.access_token,
 numberOfApiCallRetries: hubspot.NumberOfRetries.Six,
 });
 const targetContactDropdownSelect = await hubspotClient.apiRequest({ 
 method: 'GET',
 path: `/crm/v3/properties/contacts/${contactPropertyName}`
 });
 targetContactDropdownSelect.body.options.push({
 label: property,
 value: objectId,
 })
 await hubspotClient.apiRequest({
 method: 'PATCH',
 path: `/crm/v3/properties/contacts/${contactPropertyName}`,
 body: {
 options: targetContactDropdownSelect.body.options
 }
 });

```

---

<div class="post-metadata">

**Author:** ![himanshurauthan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/himanshurauthan/32/53076_2.png) [@himanshurauthan](https://community.hubspot.com/u/himanshurauthan)\
**Post date:** [May 24, 2023, 7:47am UTC](https://community.hubspot.com/t/validation-error-propertyvalidationerror-non-unique-option-labels/81837/2 "2023-05-24T07:47:05Z")

</div>

Hello @psl86

The label causing the issue is ‘Z’. Although you mentioned that it was removed from the list before, it seems that it still exists in the options.

you need to ensure that all option labels within the dropdown are unique. Here’s what you can do.  
HubSpot API to get the current options list.

```lia-code-sample
const targetContactDropdownSelect = await hubspotClient.apiRequest({ 
 method: 'GET',
 path: `/crm/v3/properties/contacts/${contactPropertyName}`
});

```

Insure ‘Z’ already exists in the options list. If it does, remove it.

```lia-code-sample
const options = targetContactDropdownSelect.body.options;
const updatedOptions = options.filter(option => option.label !== 'Z');

```

Add the new option with the label ‘Z’ and the corresponding value.

```lia-code-sample
updatedOptions.push({
 label: 'Z',
 value: objectId
});

```

Update the dropdown property with the modified options list.

```lia-code-sample
await hubspotClient.apiRequest({
 method: 'PATCH',
 path: `/crm/v3/properties/contacts/${contactPropertyName}`,
 body: {
 options: updatedOptions
 }
});

```

Now you can add the option ‘Z’ back to the dropdown property without encountering the validation error.
