Skip to main content
tejasn0320
April 4, 2024
Question

Sort Text field as Integer on record Grid

  • April 4, 2024
  • 13 replies
  • 0 views

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.

13 replies

shubhama926776
Brainy
April 4, 2024

Do you want to leverage Appian grid sorting on a column? I mean when you click on the column header, it sorts.

शुभम्
shubhama926776
Brainy
April 4, 2024

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.

शुभम्
stefanhelzle0001
Brainy
April 4, 2024

"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.

harshk1671
April 8, 2024

Can you explain what do you mean by integer sorting and text sorting here?

mikes0011
Brainy
April 9, 2024

If you sort as text, "9" would sort AFTER "1234", while as integers, 9 would sort BEFORE 1234.

harshk1671
April 9, 2024

In the current scenario the length of phone numbers is mostly same or may differ by one digit. Keeping the phone number as text and use the default grid sort will work, if I am not missing something specific here.

mathieud0001
April 9, 2024

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

April 9, 2024

[mention:ae9ebe781c79465582221db39f6b7db9:e9ed411860ed4f2ba0265705b8793d05] ,

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