Hi,
I need to put validation for two fields in below formats.
1. P (upper case).7 digits the user provided input should have first letter as capital P dot with 7 digits
2. P (upper case).7 digits.2 digits the user provided input should have first letter as capital P dot with 7 digits and dot with 2 digits
Kindly suggest on this
Discussion posts and replies are publicly visible
Input fields in Appian have a validations parameter exactly made for this case.
Thank you for the update Stefan
Yeah within in the Validation parameter trying to build logic for the above scenarios but not working so need suggestion on applying logic to show validation if above scenarios doesn't match means
Can you share what you tried so far?
Hello dharanik2600,
you can create an expression rule by designing your logic. You can try using the regex function and predetermine your required format and call this rule in your input validation parameter. I hope this is what you are asking about.
I would suggest using a regex function that comes with the regular expressions plugin.
community.appian.com/.../regular-expression-functions
Take a look at ChatGPT for generating a regex that works for you.
Hi Stefan,
please find the below sample which i tried so far
a!localVariables( local!input: "P.1234567.89", local!pattern:"^P\\.\\d{7}\\.\\d{2}$", local!isvalid: if( regexmatch(local!input,local!pattern), true(), false ), local!isvalid)
Could be slightly simplified. As for the regex, really recommend you try out ChatGPT or going on a regex forum for additional help.
a!localVariables( local!input: "P.1234567.89", local!pattern:"^P\\.\\d{7}\\.\\d{2}$", local!isvalid: regexmatch(local!input,local!pattern), local!isvalid )