# Prevent duplicates in allowed email list

**URL:** <https://community.glideapps.com/t/prevent-duplicates-in-allowed-email-list/18724>\
**Category:** Ask for Help\
**Created:** [November 21, 2020, 7:43am UTC](https://community.glideapps.com/t/prevent-duplicates-in-allowed-email-list/18724 "2020-11-21T07:43:35Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [November 21, 2020, 7:43am UTC](https://community.glideapps.com/t/prevent-duplicates-in-allowed-email-list/18724/1 "2020-11-21T07:43:35Z")

</div>

I have a pro app using allowed email list.  
I want to allow my existing users to invite new users onto the app.  
My idea is that I’ll present them with a form and ask for a name and email address.  
This will add the potential new user to the allowed email list, and trigger an email to the new user with instructions.  
I’m fairly confident that I can handle most of this, but the one thing that has me stumped is how to prevent my users from creating duplicates in the allowed email list (and prevent it happening in real time).  
Ideally what I’d want to do is prevent them from submitting the form if it will create a duplicate email address.

Any suggestions?

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [November 21, 2020, 8:05am UTC](https://community.glideapps.com/t/prevent-duplicates-in-allowed-email-list/18724/2 "2020-11-21T08:05:52Z")

</div>

Make two user-specific columns and store the input name and email address temporarily, the button would write a new row in your user profiles sheet if there’s no duplicates, else you show a fail notification.

The duplicate will be checked by a relation.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [November 21, 2020, 8:07am UTC](https://community.glideapps.com/t/prevent-duplicates-in-allowed-email-list/18724/3 "2020-11-21T08:07:06Z")

</div>

I figured it would be something like that.  
Thanks, I’ll give that a try 👍

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [November 22, 2020, 12:36pm UTC](https://community.glideapps.com/t/prevent-duplicates-in-allowed-email-list/18724/4 "2020-11-22T12:36:36Z")

</div>

> [@ThinhDinh](#):
>
> The duplicate will be checked by a relation.

I just had a go at this. Started by creating a relation, as follows:

 ![Screen Shot 2020-11-22 at 8.15.15 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/e/eef571e242b5c2cc09501f9f2c54ce541a7c6d67.png)

I then added a button with a custom action, and tried to include a condition to check if the entered email address is included in this relation. But the relation does not appear as an option.

 ![Screen Shot 2020-11-22 at 8.16.45 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/1/41c40da20f63d63d99fcc12695fba10bfdffe6cf.png)

What am I missing?

---

<div class="post-metadata">

**Author:** ![kyleheney](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kyleheney/32/41173_2.png) [@kyleheney](https://community.glideapps.com/u/kyleheney)\
**Post date:** [November 22, 2020, 1:20pm UTC](https://community.glideapps.com/t/prevent-duplicates-in-allowed-email-list/18724/5 "2020-11-22T13:20:07Z")

</div>

Not sure, but you may have to create a Joined List of the values the relation is pulling in and use that for your “included in” check.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [November 22, 2020, 1:27pm UTC](https://community.glideapps.com/t/prevent-duplicates-in-allowed-email-list/18724/6 "2020-11-22T13:27:29Z")

</div>

I would create a user specific column to store the input email, then make a relation of that input email to the existing email list. If relation is empty then record, if not then show fail notification.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [November 22, 2020, 1:32pm UTC](https://community.glideapps.com/t/prevent-duplicates-in-allowed-email-list/18724/7 "2020-11-22T13:32:50Z")

</div>

ah-hah! Thank you 👍

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [November 22, 2020, 1:33pm UTC](https://community.glideapps.com/t/prevent-duplicates-in-allowed-email-list/18724/8 "2020-11-22T13:33:40Z")

</div>

> [@kyleheney](#):
>
> Not sure, but you may have to create a Joined List of the values the relation is pulling in and use that for your “included in” check.

I did actually try this, and it worked. But it seemed a bit clunky.

---

<div class="post-metadata">

**Author:** ![kyleheney](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kyleheney/32/41173_2.png) [@kyleheney](https://community.glideapps.com/u/kyleheney)\
**Post date:** [November 22, 2020, 3:55pm UTC](https://community.glideapps.com/t/prevent-duplicates-in-allowed-email-list/18724/9 "2020-11-22T15:55:01Z")

</div>

Yeah I think it, or a lookup for a single relation is necessary. A relation is just relating to the whole row, so I think the “is included in” needs a more specific field to look at.
