I Create a validation query that check if the emails exist in the RDBMS, if email does not exist the validation shown like this,
but I struggle in the multiple message because I used a!foreach for that.How this text make as one only?
Discussion posts and replies are publicly visible
Try replacing the text "Couldn't find your Account" with true() and wrap the a!foreach() with or() to check if any of the emails are not in the database.
So if your condition is
Validation: a!foreach(array, if(fv!item not in database, "Couldn't find your Account", null)
Replace it as:
Validation: if(or(a!foreach(array,if(fv!item not in database, true, false)) = true, "Couldn't find your Account",null)
validations : a!foreach( items: rule!checkEmails(emails: ri!email),expression: if(fv!item.emails = ri!emails, null, "Couldn't find your account")) Here's my actual code
Hi Try like this
if( isnull(rule!checkEmails(emails: ri!email)), "Couldn't find your account", "" )
Seem like you want to check whether the entered email address is contained in the list ri!email. Is that correct?
Is that a static list or data from DB? In case of DB, I would do a query to DB trying to find a match.
it's a query to DB, if the entered email exist the validation doesn't shown, but if the entered email not exist, the validation show to remind the user the email they entered does not exist. when I use foreach it show the error multiple base on my data I have on the DB
OK. It seems that you load all email addresses into the interface and then try to compare each to the value entered. Is that correct?
If yes, please create a query which searches in DB for the entered value. In case there is no result, you know that the email does not exist.