Skip to main content
December 9, 2021
Solved

Validations Query

  • December 9, 2021
  • 9 replies
  • 0 views

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?

Best answer by tajinders0001

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)

9 replies

andrewh0007
December 9, 2021

What's your code?

tajinders0001
December 9, 2021

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)

December 9, 2021

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

gayathris111098
December 9, 2021

Hi 


Try like  this

if(
isnull(rule!checkEmails(emails: ri!email)),
"Couldn't find your account",
""
)



foreach can be used only if you want to check for multiple items from your image I can see user gonna type is single email only.

stefanhelzle0001
Brainy
December 9, 2021

I also would be interested in the actual code. I try to understand what the purpose of the forEach() is.