Need help checking inputted email against the domain stored in databaes

I’m building an app for students at specific colleges to meet each other based on interests and hang out. I’m having trouble with verifiying the domain for the users

What I have right now:

Database:
Users:

School:

I have a view where the user can select a school (only have one so far) and I’m pretty sure in my workflow, it changes the current user’s school domain to the domain of the school they clicked.

On the “Create Account” view, I have the user input their name, emails, and password. Here’s the workflow before:

The issue right now is that when I test it out in the preview, the it still goes to the following view when I use my gmail (rather than the school.edu domain I set).

I’m trying to make a workflow that checks the entered email against the college domains stored in the School data type. If it doesn’t then it’ll send an error message.

What do I do? Thank you!

In the last image you put it looks like you are comparing an email address with a domain.. is this correct? I think that if this were the case, this condition can rarely be verified.. What do you have in the domain field? (I assume gmail, schoolexample…)

Hey :waving_hand:

You need to extract the domain from the email to compare it. Try this: Operators and comparisons | Bubble Docs

Hope that helps. :blush:

Yes, I’m comparing the user’s inputted email with the user’s school’s domain. The domain is name@school.edu, which is set when the user selects a school in the precedent view.

What should I change?

Hey, does this work?

I suggest using the debug step by step. Or display both values in a text field on the page so you can clearly see what you are comparing. But yes, that is the basic idea. It just depends how you are saving the domain in the database. :blush:

Also, you can only compare the current users school if you saved it somewhere else before this step. :blush:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.