# Url import exception, value is not unique

**URL:** <https://forum.litium.com/t/url-import-exception-value-is-not-unique/943>\
**Category:** Questions\
**Tags:** litium-6\
**Created:** [June 26, 2019, 8:37am UTC](https://forum.litium.com/t/url-import-exception-value-is-not-unique/943 "2019-06-26T08:37:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![krilin](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/krilin/32/175_2.png) [@krilin](https://forum.litium.com/u/krilin)\
**Post date:** [June 26, 2019, 8:37am UTC](https://forum.litium.com/t/url-import-exception-value-is-not-unique/943/1 "2019-06-26T08:37:14Z")

</div>

Hi!

When we are importing new variants and we sometimes get url error:

Article import error: [CreateArticle] Validation error for Variant(SystemId: cc5f755c-df3a-460a-b96f-765dabd1c01f, Id: 02116090102), Localization[nb-NO].Url: ‘Value is not unique.’, Localization[en-US].Url: ‘Value is not unique.’, Localization[sv-SE].Url: ‘Value is not unique.’ and Localization[de-DE].Url: ‘Value is not unique.’

We are using the ISuggestionService to avoid this:

```
string url = urlSuggestions.Suggest(language.CultureInfo, suggestFrom);
_variant.Fields.AddOrUpdateValue("_url", language.CultureInfo, url);                            

```

Shouldn’t this guarantee that we get an unique url?

If not, how can we make sure the url is unique before saving the variant?

/Kristoffer

Litium version: 6.3

---

<div class="post-metadata">

**Author:** ![marten](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/marten/32/11_2.png) [@marten](https://forum.litium.com/u/marten)\
**Post date:** [June 26, 2019, 9:05am UTC](https://forum.litium.com/t/url-import-exception-value-is-not-unique/943/2 "2019-06-26T09:05:54Z")

</div>

Suggest does check if the url is already taken, it only formats the provided string to a valid url.

An easy solution is to catch the specific error and keep trying to save with a suffix on the url (“url\_1”, “url\_2”).

Also check: [How to check for URL conflicts without creating a entity?](https://forum.litium.com/t/how-to-check-for-url-conflicts-without-creating-a-entity/383)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/12eddac3b8b661de1db86af10ac8151b571e6fb9.png) [@system](https://forum.litium.com/u/system)\
**Post date:** [July 24, 2019, 9:05am UTC](https://forum.litium.com/t/url-import-exception-value-is-not-unique/943/3 "2019-07-24T09:05:55Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
