Search for unique element with new user

Hi all - I’m requiring phone numbers for signup of a particular class of users on my app. I need these to be unique, so am doing a search for users to see that the phone number is not currently in the database of existing users. This can be a condition on sign-the-user-up or on go-to-page.

Only problem is this evaluates to a list of users, and Bubble needs this to evaluate to a Yes/No. Can anyone see what I’m doing wrong here?

Switch the constraint <> to = then add :count is 0 after Search for Users

Also privacy rules will need to allow the search to find other user’s phone numbers which may not be ideal, @georgecollier what do you think. Maybe backend workflow returning a yes/no instead

1 Like

Thanks, that solution solves the problem.

Leaving this open for the moment so that discussion about privacy rules can continue.

1 Like

Why not add the condition before the workflow starts? i.e. before you sign the user up.

Since if a user signs up with the same phone number form another user, what would happen then? The action sign the user up wouldn’t run since you have a condition - impacting the subsequent actions.

Currently, you don’t have a way to catch these errors. The actions simply wouldn’t run hence a drop off. The user wouldn’t know what to do and would be lost

You could add phone number checker in the frontend similar to other websites where you would click a button and it would check if the phone number is available or not.

This, however, could impact your WUs especially when you scale and if users input phone numbers that already exists in your database, but hey you gotta do what you gotta do to improve your UX right.

Yeah, users shouldn’t be able to see other user’s phone numbers. Create a public backend workflow that requires auth and bypasses privacy rules. It takes a phone number parameter and returns ‘phoneNumbeExists’ (yes/no). Call that workflow from front-end using API connector or app connector and use that as your condition.

1 Like

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