Hi all,
I am working on a project, I want to restrict the end user to enter the duplicate email ids or mobile numbers. I mean, end user cannot enter the email or mobile number if it's already exist in the Database.
It should show an error message if user entered existed email id on the interface.
Solutions would be highly appreciated.
Thank you in advance!
Discussion posts and replies are publicly visible
Hi Shubham, you can get all email ids from db in a local variable and then configure the validation parameter of the text field using an expression (use "contains" function) which will check if entered value exists or not in the local variable you pulled of email ids. And the. Conditionally you can show some message to the user.
I don't think fetching ALL emailids into a local variable and then conducting a local lookup is very scalable. Imagine if the database had 10 million unique values for email addresses? Better to run a Query Entity to match on the entered emaiId and restrict the result set to 1 row (batchSize: 1),. The resultant datasbuset would wither have 0 or 1 items in the returned data.
You are right Stewart. For scalibility , your approach would be great. I just thought about less data in db.
Thanks Gopalk, but getting all email ids will not be right solution if data exceeded in future. performance will get slow.
By the way, Thank you so much for your answer.