Sorting integer field

gustavo1
Kilo Contributor

Hi all,
I'm having an issue trying to sort a list by a integer field, I don't understand why but when I sort the list by 'Project Ranking' field which is integer type sorts the list in the order below:
1
10
11
12
13
.
.
.
2
20
21
.
.
.
3

What do I need to get the right sort?
1
2
3
.
.
.
10
11
12
.
.
.
20

Is there somethin I'm missing on the Dictionary?
Thanks in advance for your responses.

4 REPLIES 4

CapaJC
ServiceNow Employee
ServiceNow Employee

Sounds like it's not really an Integer field, but rather a String that just happens to be storing integers.

Is this an out-of-box field (if so, in which table?), or a custom one?


gustavo1
Kilo Contributor

It's a custom field in the Project table which do is a out-of-box table, the strangest thing is that I've created the same field using an update set in Dev, then I moved the changes to Test and Production instances, but only in Dev instance works, I already reviewed the dictionary in the three instances and is exactly the same, and I have nothing set in the Defaultsort field in any field, so I don't know what is happening, any advice?
Thanks again for the support.


I have to agree with Capa on this one. It sounds like something isn't working the way it should, talking to SN support would be your best course of action.

Even if it's a string field you should be able to sort it numerically.


CapaJC
ServiceNow Employee
ServiceNow Employee

Hmm. If creating an Integer field in /dev results in the field being sorted as a String in update set "downstream" instances, I'd call that a bug. I haven't heard of that happening before.

Might be worth having Customer Support take a closer look at what happened.