Hello,
I have a field for mobile numbers in my Appian application, but it is in text format instead of integer. Appian does not support 10 digits as an integer, so I cannot change it. I need to sort this mobile number field on a read-only grid, but it is sorting as a string due to the text format. I need it to be sorted as an integer field.
Discussion posts and replies are publicly visible
Do you want to leverage Appian grid sorting on a column? I mean when you click on the column header, it sorts.
To sort mobile numbers as integers in an Appian readonly grid:
Create a hidden integer field in your data source.Convert text mobile numbers to integers and populate the hidden field.Include both text and hidden integer fields in the grid.Configure the grid to sort based on the hidden integer field.
Yes it sorts it for the string but as these are numbers want to sort them according to numbers will try out the suggestion
Do let me know if it works for you.
"Numbers" like phone/ZIP/ID/street, are not to be stored as numbers! While in some countries these values are numeric only, in many countries they are alpha-numeric.
Can you explain what do you mean by integer sorting and text sorting here?
Like other have already mentioned, I would recommend storing phone numbers as text.
It's quite easy to validate a phone number and formatting it as a string on save. You could even create a Custom Record field that strips all the formatting characters to help with the sorting.
Appian even has an example on how to create such a field: docs.appian.com/.../fnc_text_isphonenumber.html
Integer datatype in Appian isn't capable of storing a 10-digit mobile number. I would still advise going with a text type
tejas_n ,
I think you can make on custom record field with type decimal and cast this text field to decimal then use this custom field for the sorting, if you are using record as data source
If you sort as text, "9" would sort AFTER "1234", while as integers, 9 would sort BEFORE 1234.