Out of range value for column error

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

Parents Reply
  • 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.

Children
No Data