In the expense Item name field I don't want that the user can put there numbers. If done, It should return error as "don't put numbers in the text field."
Discussion posts and replies are publicly visible
hi vikashk,
a!textfield() has a validation attribute called "validations".
checkhttps://docs.appian.com/suite/help/18.4/Text_Component.html
you can use a if clause here. Example of several ways to solve it:
validations: if( contains( a!forEach( items: enumerate(10), expression: search(tostring(fv!item),local!saveInto,1)=0 ), false ), "dont put numbers", {} )
Richard's suggestion should do the trick! I also like to use the cleanwith() function to identify any uses of numbers in a text string:
a!textField( label: "Text", saveInto: ri!text, value: ri!text, validations: { if( isnull( cleanwith( ri!text, "1234567890" ) ), null, "Please provide only letters" ) } )
Hi peter,
thank you for your valuable response.
I was originally on the same path with cleanwith. :) I dismissed it because it filteres inserted values and asks, if something is left. Works fine for pure inserted numbers. does this work for alphanumeric ?
haven't tested it. Thank you for your input.
Yep, it will work for alphanumeric too! For example, if the text string I gave was "abc123", the cleanwith() example I showed above would return "123". The reason I like this function is that you don't have to do any looping - just provide the text you want to look for and it will identify if any of them are present.