# Multiple unique key fields

**URL:** <https://forum.mautic.org/t/multiple-unique-key-fields/8248>\
**Category:** Product Support\
**Created:** [April 19, 2017, 4:21am UTC](https://forum.mautic.org/t/multiple-unique-key-fields/8248 "2017-04-19T04:21:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sujithm](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@sujithm](https://forum.mautic.org/u/sujithm)\
**Post date:** [April 19, 2017, 4:21am UTC](https://forum.mautic.org/t/multiple-unique-key-fields/8248/1 "2017-04-19T04:21:48Z")

</div>

Hello  
  
I have a doubt regarding unique key fields in Mautic. By default, “email” field is set as unique. If I add a custom field (for example “brand”) and set as unique, then will Mautic add separate contacts if any of these keys has a different value? I use tracking pixel for adding contacts.  
  
  
  
Let me state an example here. Here both “email” & “brand” fields are set as unique  
  
  
  
Scenario 1:  
  
First added a contact with email as "xyz@xyz.com" and brand as “XYZ”  
  
Then add a contact with email as "xyz@xyz.com" and brand as “ABC” (same email, but different brand)  
  
Here will mautic add two separate contact details, or will merge it and set the “brand” field as “ABC”?  
  
  
  
Scenario 2:  
  
First added a contact with email as "xyz@xyz.com" and brand as “XYZ”  
  
Then add a contact with email as "abc@abc.com" and brand as “XYZ” (same brand, but different email)  
  
Here will mautic add two separate contact details, or will merge it and set the “email” field as "abc@abc.com"?  
  
  
  
Can anybody provide any information on this? What I understand is that unique key is same as primary key. Please correct me if I am wrong.  
  
  
  
Thanks & Regards  
  
Sujith

---

<div class="post-metadata">

**Author:** ![sujithm](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@sujithm](https://forum.mautic.org/u/sujithm)\
**Post date:** [April 19, 2017, 4:21am UTC](https://forum.mautic.org/t/multiple-unique-key-fields/8248/2 "2017-04-19T04:21:48Z")

</div>

Hello  
I have a doubt regarding unique key fields in Mautic. By default, “email” field is set as unique. If I add a custom field (for example “brand”) and set as unique, then will Mautic add separate contacts if any of these keys has a different value? I use tracking pixel for adding contacts.

Let me state an example here. Here both “email” & “brand” fields are set as unique

Scenario 1:  
First added a contact with email as "xyz@xyz.com" and brand as “XYZ”  
Then add a contact with email as "xyz@xyz.com" and brand as “ABC” (same email, but different brand)  
Here will mautic add two separate contact details, or will merge it and set the “brand” field as “ABC”?

Scenario 2:  
First added a contact with email as "xyz@xyz.com" and brand as “XYZ”  
Then add a contact with email as "abc@abc.com" and brand as “XYZ” (same brand, but different email)  
Here will mautic add two separate contact details, or will merge it and set the “email” field as "abc@abc.com"?

Can anybody provide any information on this? What I understand is that unique key is same as primary key. Please correct me if I am wrong.

Thanks & Regards  
Sujith
