Hello All
I want to add a field that accept only 21 digits of number I tried to use a!integerField but is not allowed to enter too long numbers
Discussion posts and replies are publicly visible
Hi alaaa6815
You can use textField and validate the field if the user's input is not valid as integer field does not accept more than 10 digits.
Try the below code and lemme know if it works for you
a!localVariables( local!input, a!textField( label: "Text", labelPosition: "ABOVE", value: local!input, saveInto: local!input, refreshAfter: "UNFOCUS", validations: if( a!isNullOrEmpty(local!input), {}, if( or( len(local!input) > 21, regexmatch("[^0-9.]", local!Input) ), "Invalid Input", "" ) ) ) )
The largest value integer can store on Appian is 2147483646 and after that, it takes it back to negative.
Because you want to store 21 digits, you can use textField with length validation and another validation that makes sure the user is only entering numbers.
a!textField( characterLimit: 21, value: ri!value, saveInto: ri!value, validations: if( a!isNullOrEmpty(stripwith(ri!value,"1234567890")), {}, "Value can only contain numbers" ) )
NOTE - You will also need to change the Datatype of your CDT field, Record field, and DB column to text.
Thank you Kraty Maheshwari
Thank you Harshit Bumb (Appyzie)