HI ,
i am getting below error.I am doing a validation for phone number is...if(len(ri!NewAccountDetails.PhoneNumber)<11, {},"Enter 10 digits only") and storing the value in data store.
if i am giving ohonenumber 10 digits i am getting below error.help me on this.
an error occurred while trying to write to the entity “Newrequest” [id=e423e5e0-a8e0-49a5-b302-1e94daa84282@16567, type=NewAccountDetails (id=5182)] (data store: Account Store). Details: org.hibernate.exception.DataException: could not insert: [NewAccountDetailsDT4918]: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Out of range value for column 'phonenumber' at row 1 Data: TypedValue[it=5182,v={<null>,xxxx,9648837673,,<null>,,<null>,,Savings}]
Thanks,
Discussion posts and replies are publicly visible
Please confirm the data type of column 'phonenumber' in MySQL, you may be providing a value larger than the data type can handle.
Hi Chris,
I iam using "Text " Data type.But I have tried integer also .if I used integer it's taking only single value should be 1234567890 apart from this value it's not taking any new digits like phone number start with 987...... Or 877666.... Getting error
Hi Sasikala,
Could you please provide a screenshot for the cdt - NewAccountDetails?
Typically you'd simply want to treat phone numbers as Text, both in Appian and in the Database. This is because you usually want to handle international calls - so the + symbol to indicate a country code; and/or area codes, usually wrapped in () ; and also spaces to make it easier for end-users to read (people can hold numbers better in their heads if they're 'chunked') e.g. +44 (0) 1508 571234
If you want to validate a phone number that is being captured then there are RegEx expressions available to ensure they conform to an expected pattern.
So, in short: use a Text Field in your User Interface; a Text attribute in the CDT; and a Text column in the Database, all of the same length.
What does your database table look like? Do you also have a text field in the column in your database? Also what is the length of the column in the database (even if you use text)?