# Form to add data -\> duplicate entries

**URL:** <https://forum.bubble.io/t/form-to-add-data-duplicate-entries/156451>\
**Category:** Database\
**Created:** [June 20, 2021, 9:53am UTC](https://forum.bubble.io/t/form-to-add-data-duplicate-entries/156451 "2021-06-20T09:53:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fok\_ste](https://avatars.discourse-cdn.com/v4/letter/f/ba8739/32.png) [@fok\_ste](https://forum.bubble.io/u/fok_ste)\
**Post date:** [June 20, 2021, 9:53am UTC](https://forum.bubble.io/t/form-to-add-data-duplicate-entries/156451/1 "2021-06-20T09:53:47Z")

</div>

Hi,  
I’ve a form with different fields. One of them shall be unique within the database.

I tried to do it this way - but it failed.

There is a submit button - and the button shall be disabled OR the data shall not be created when there is a duplicate domain

![image](https://us1.discourse-cdn.com/bubble/original/3X/8/9/8966239bdc6d7c0520ba81a0c5ecefbec76c15bf.png)

---

<div class="post-metadata">

**Author:** ![mikeloc](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mikeloc/32/93001_2.png) [@mikeloc](https://forum.bubble.io/u/mikeloc)\
**Post date:** [June 20, 2021, 1:38pm UTC](https://forum.bubble.io/t/form-to-add-data-duplicate-entries/156451/2 "2021-06-20T13:38:48Z")

</div>

Hi there, @fok_ste… if I understand your post and your screenshot correctly, you put a condition on the input element that says when the input’s value is not unique, the input must not be empty. With that condition in place, the system will create a duplicate entry because it is only checking to make sure the input is not empty as opposed to stopping the creation of a new thing because the input’s value is the same as one that already exists.

You should remove the condition from the input element and put a similar condition (although, I would likely change it form `is 1` to `> 0` so the system can stop searching as soon as the count is greater than 0) on the submit button that prohibits the button from being clicked when the condition is true. You could also consider having the first step in the submit button’s workflow be a step that terminates the workflow only when the input’s value is not unique.

Hope this helps.

Best…  
Mike

---

<div class="post-metadata">

**Author:** ![fok\_ste](https://avatars.discourse-cdn.com/v4/letter/f/ba8739/32.png) [@fok\_ste](https://forum.bubble.io/u/fok_ste)\
**Post date:** [June 20, 2021, 2:10pm UTC](https://forum.bubble.io/t/form-to-add-data-duplicate-entries/156451/3 "2021-06-20T14:10:46Z")

</div>

Hi Mike,  
I tried to put this into the workflow for the submit button as following:

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/a/4/a4d1a2bdb68bf28a48ecec966694173eef85c4ec.png)

but I’m still able to add the same data multiple times. any idea?

---

<div class="post-metadata">

**Author:** ![mikeloc](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mikeloc/32/93001_2.png) [@mikeloc](https://forum.bubble.io/u/mikeloc)\
**Post date:** [June 20, 2021, 2:35pm UTC](https://forum.bubble.io/t/form-to-add-data-duplicate-entries/156451/4 "2021-06-20T14:35:41Z")

</div>

For that condition, I believe the count should be `is 0`. Want to give that a shot?

---

<div class="post-metadata">

**Author:** ![fok\_ste](https://avatars.discourse-cdn.com/v4/letter/f/ba8739/32.png) [@fok\_ste](https://forum.bubble.io/u/fok_ste)\
**Post date:** [June 20, 2021, 3:27pm UTC](https://forum.bubble.io/t/form-to-add-data-duplicate-entries/156451/5 "2021-06-20T15:27:22Z")

</div>

ahh… you’re right… working fine now 🙂 Many thanks.
