Let Users register that have a specific domain in Mail

Hello!

I try to limit the domains that are allowed to register on the registration form.

My current idea is:

  • Setup database “domains”, with a field “domain name”
  • In the registration form workflow -> only when: Do a search for domains:count >= 1

The problem: I can only set “domain name contains email input”, but that wont work. The domain name wont contain the whole email input.

Anyone has an idea how to implement this behaviour? Do I have to use regex?

Thanks!

Your approach is on the right path. To round it out, you can use the “extract” function to get the top level domain. Then, apply your search based on that.

Oct%2025%202018%208_16%20AM

Dan (creator of LearnTo - 125+ Bubble tutorials)

Thanks for your reply!

Unfortunately this does not work in my workflow.

Do you have any idea what could be wrong?

Can you elaborate on “does not work in my workflow”? I’m not sure what the bug is based on what you shared :slight_smile:

Regardless, it’d be better to move the “Only when” condition to the overall workflow instead of the Sign the user up action.

You may also encounter issues base on case sensitive values (ie Stanford.edu is different than stanford.edu). So normalize the values in your database and normalize the text entered by the user by using the :lowercase function.

Thanks for your feedback! I totally forgot about the lowercase thing.

I have tried to set it up like this but the condition “Search for Universitys:count is 1” is never true, even if the input mail has a domain that is on the list.

I can’t imagine why it wouldn’t work. :frowning:

I’m happy to take a closer look. But need you to share either some more screenshots of your setup or a PM with a link to your editor. Otherwise, hard to point to a specific issue.

@dan1 Thanks for your reply!

I have attached the complete workflow.

Button “sign up”
image

Database

Whats not working?
Clicking on signup with the correct domain entered does not trigger the workflow.
It does not find the domain match (= the return count is 0).

Did I miss something?

Thanks in advance!

Try doing something without the “-” in the name. There’s a chance you’re mixing up em dashes and en dashes.

As well, if you have any privacy roles set, a user may not be able to see this data. (Since they are not logged in at this point). The domain name field would need to be publicly accessible / found in search.

Lastly, try clicking on somewhere else on the page first, then clicking on the button. It may be that the button hasn’t picked up on the condition.

Otherwise, that’s all that immediately comes to mind based on what you’ve provided.

@dan1 Privacy roles - that fixed it!

Thank you very much!

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.