Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Custom error text for regex validation failure on create user form

haardik_verma
Regular Contributor
Regular Contributor

Hi,

My "Create User" form includes the Email attribute with generic email regex.

If the email is invalid, I want it to show custom text as mentioned in the dynamic attribute option of "Failure Message". But it shows something else.

Below is the dynamic attribute

haardik_verma_0-1711467549451.pnghaardik_verma_1-1711467565103.png

haardik_verma_2-1711467585989.png

Where the regex is ^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+$

When I enter an invalid email in the form, I want to see "Invalid email" but instead I see "Regex Validation Failed For Email"

haardik_verma_3-1711467671175.png


I tried adding the regex in "Validation Condition" but it did not work for me and was giving error in that page.


Thanks & Regards,
Haardik Verma
13 REPLIES 13

CR
Regular Contributor III
Regular Contributor III

Looks regx not valid

try below

^[a-zA-Z0-9.@_-]+$

 


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

haardik_verma
Regular Contributor
Regular Contributor

Hi @CR ,

The regex is fine and I have tested it.. My ask is when someone enters invalid email address, I want it to say "Invalid Email" or whatever I want it to say, instead of "Regex Validation Failed For Email"

 

Also, the regex that you shared ^[a-zA-Z0-9.@_-]+$ is not for an email.


Thanks & Regards,
Haardik Verma

CR
Regular Contributor III
Regular Contributor III

@haardik_verma  custom message only based validation attribute thgh it will display as per document

CR_0-1711472983299.png

https://docs.saviyntcloud.com/bundle/EIC-Admin-v24x/page/Content/Chapter13-Access-Requests/ars-mang-...

 

 


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

PremMahadikar
Regular Contributor III
Regular Contributor III

Hi @haardik_verma ,

Try this,

1. Use the below code in 'Validation Condition'

 

!email.matches(^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+.[a-zA-Z0-9.-])

 

2. and have the custom message in 'Failure message'

Note: Failure message is only displayed for validation condition and not for regex

If this answers the question, please consider selecting 'Accept As Solution' and hit 'Kudos'

Hi @PremMahadikar ,

The validation condition did not work for me..

When I enter "test" in the email, which is supposed to fail the condition, it gives me error popup and a blank popup

haardik_verma_0-1711514995535.pnghaardik_verma_1-1711515000986.png

Hi @rushikeshvartak ,

Can you please share how to add a note? 

Only thing I can find was a longtext type attribute, which I tried using as seen in the screenshot above.


Thanks & Regards,
Haardik Verma

use checkbox - label


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Hi @rushikeshvartak ,

I do not see label checkbox

haardik_verma_0-1711519044585.png

 


Thanks & Regards,
Haardik Verma

rushikeshvartak_0-1711599321076.pngrushikeshvartak_1-1711599347249.png

 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Thanks @rushikeshvartak 

Works for me

haardik_verma_0-1711608990989.png

 


Thanks & Regards,
Haardik Verma

Please click the 'Accept As Solution' button on the reply (or replies) that best answered your original question.


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

CR
Regular Contributor III
Regular Contributor III

@haardik_verma  can you post working DA config screenshot


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

haardik_verma
Regular Contributor
Regular Contributor

Hi @CR ,

I have not been able to achieve an ideal solution for this as of now.

My original setup:  I was using "Regex" as ^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+$ 

With this, I was able to get the functionality working correctly but the error shown when regex fails is the default one i.e., "Regex Validation Failed For Email"

In addition to what I was originally doing,  I am displaying basic email rules as a checkbox attribute as Rushikesh suggested; 

----------------------------------------------------------------

My ideal solution is to get a custom text displayed when invalid email is entered, which will require me to use "Validation Condition" instead of "Regex"

I tried the regex that @PremMahadikar shared

!email.matches(^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+.[a-zA-Z0-9.-])

but it is not working correctly for me.

My attribute name is email2 and I tried the below options in "Validation Condition" and "Invalid Email Test" in the "Failure Message"

!email2.matches(^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+.[a-zA-Z0-9.-])

email2.matches(^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+.[a-zA-Z0-9.-])

I am getting failure message even for valid emails

 

haardik_verma_1-1713163436184.png

here abc@test.com is a valid email but still I am getting error.

Hence I am continuing with my original setup for now, until I get a solution.

 

 


Thanks & Regards,
Haardik Verma

rushikeshvartak
All-Star
All-Star

Currently Regex Message is generic. What we followed approch is used note section to display allowed character and sample format

rushikeshvartak_0-1711507149836.png

 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.