Prevent duplicates in allowed email list

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?

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.

2 Likes

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

2 Likes

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

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.

What am I missing?

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.

1 Like

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.

1 Like

ah-hah! Thank you :+1:

1 Like

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

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.