Hi All,
How to validate an email address for users which are in same organization. If I am working in a abc organization and I want to validate that if users is not a part of an abc organization should show me invalid email address in textfield object in appian and if it is a valid user of that organization doesn't show me an error.
Example:
1. hdhdh@abc.com
2. xyz@abc.com
3. adrfer@abc.com
From above examples that users who is a part of abc organization then in textfield show me invalid email address. So my point is in one organization I need to validate users if it is valid no error should show in interface if it is not valid user then show me an error.
Please guide me how to achieve these in a!textfield() function under appian 22.2 version?
Discussion posts and replies are publicly visible
You can create a regular expression and use regexmatch function to validate the email address.Example:
regexmatch( concat( "^[A-Za-z0-9._%+-]+@", /*your organisation domain*/ "abc", "\.com$" ), "test.user@abc.com" )
Hi Yash,
you could use find() function, if it throws 0, then it is not in the text, if it throws any other position then it is correct.
Check the next example:
a!localVariables( local!value:"ashf@asd.com", local!value2: "ashf@abc.com", { a!textField( value: local!value, validations: if(find("@abc.com", local!value) <> 0, "", "not correct email" ) ), a!textField( value: local!value2, validations: if(find("@abc.com", local!value2) <> 0, "", "not correct email" ) ), } )
Why do you need to parse email addresses to do this? In a normal environment, all members of your organization would have an Appian user account and you would know that !?!?
A better way to do this would be to integrate with your company active directory and validate that the user is indeed valid and not just rely on the format.