hi,
i use 22.3 version
i have an condition in text field
in that i want only alphabetical character (A-Z) not numerical or special character
how to do that
Discussion posts and replies are publicly visible
You can use regexMatch function to make it according to regex. But for than you have to deploy Regex expression plugin in your environment
If you do not want to add a dependency on the plugin, then you can use this code.
if( and( a!forEach( items: code(ri!name), expression: or( and(fv!item >= 65, fv!item <= 90), and(fv!item >= 97, fv!item <= 122) ) ) ), {}, "Cannot contain numbers or special characters" )
you can try this.
if( contains( cast( runtimetypeof(ri!input), stripwith( cleanwith( ri!input, joinarray( { "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ" } ) ), " " ) ), ri!input ), "", "Please use alphabetical characters only.")
Simplified it a bit.
if( a!isNotNullOrEmpty( stripwith( ri!name, lower("ABCDEFGHIJKLMNOPQRSTUVZXYZ") & "ABCDEFGHIJKLMNOPQRSTUVZXYZ" ) ), "Can only contain alphabets", {} )
cool, :)