Skip to main content
Nintex Community Menu Bar

Multiple email validations

  • June 7, 2020
  • 1 reply
  • 14 views

Forum|alt.badge.img

Hello experts,

 

I have comma separated email ids, which stored in multiple line text variable, i want to validation each email. 

 

Example : xyz.zyx@xyz.com,myweb.xyd@xyz.com,myhr@myhr.com

 

How can i validate it in nintex workflow.

 

Please help 

1 reply

Forum|alt.badge.img+8
  • Novice
  • June 8, 2020

Hi,

I´d start with seperating your values at the comma and then test each email individually.

 

So in your workflow, create three new variables 

  1. col_Mails (collection variable, stores the individual mails)
  2. tmp_str_Mail (single line of text, stores a single mail in a foreach loop)
  3. tmp_bool_Match (yes no, stores if tmp_str_Mail is an e-mail address)

Start with a regex operation:

pattern ,
Operation split
Input text your_variable_containing_mails
store result in col_Mails

 

After that, put a for each action:

target collection col_Mails
store result in tmp_str_Mail

 

In the for Each, put a Regular Expression which evaluates, if tmp_str_Mail is a correct Mail.

According to https://emailregex.com/ this expression should capture 99.99% of mail-addresses out there.

(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[x01-x08x0bx0cx0e-x1fx21x23-x5bx5d-x7f]|\[x01-x09x0bx0cx0e-x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[x01-x08x0bx0cx0e-x1fx21-x5ax53-x7f]|\[x01-x09x0bx0cx0e-x7f])+)])

 Regular Expression

Pattern (?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[x01-x08x0bx0cx0e-x1fx21x23-x5bx5d-x7f]|\[x01-x09x0bx0cx0e-x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[x01-x08x0bx0cx0e-x1fx21-x5ax53-x7f]|\[x01-x09x0bx0cx0e-x7f])+)])
Operation Check match
Input tmp_str_Mail
Store result in

tmp_bool_Match

 

After that, you can place an if and do things according to if the mail matches or not