and more in a single search tool across platforms. Read the announcement here. |
03/26/2024 08:42 AM
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
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"
I tried adding the regex in "Validation Condition" but it did not work for me and was giving error in that page.
03/26/2024 09:03 AM
Looks regx not valid
try below
^[a-zA-Z0-9.@_-]+$
03/26/2024 09:17 AM - edited 03/26/2024 09:18 AM
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.
03/26/2024 10:10 AM
@haardik_verma custom message only based validation attribute thgh it will display as per document
03/26/2024 04:44 PM - edited 03/26/2024 04:53 PM
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'
03/26/2024 09:51 PM
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
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.
03/26/2024 09:52 PM
use checkbox - label
03/26/2024 10:57 PM
03/27/2024 09:16 PM
03/27/2024 11:56 PM
04/14/2024 10:23 AM
Please click the 'Accept As Solution' button on the reply (or replies) that best answered your original question.
04/14/2024 08:09 PM
@haardik_verma can you post working DA config screenshot
04/14/2024 11:46 PM
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
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.
03/26/2024 07:39 PM
Currently Regex Message is generic. What we followed approch is used note section to display allowed character and sample format