Trouble with SORT BY DESC for field with Autonumber
Asked by Satyajit Shukre:

I have a Confiforms Form on Page 1 and the user submits a request using this form. This form has multiple fields, and the same form is used for multiple units. The user selects a dropdown for a unit and submits the form after filling in other details, some of which are mandatory and some not mandatory.

This form (Page 1) has a field called EngagementID which is an Autonumber, which is generated for every new form filled and submitted. This was started from 1000 to give 4 digit EngagementID numbers from the start.

I have a Page 2 where all records related to Unit X are shown using the TableFilter Macro and the ConfiForms TableView Macro, where only certain fields are shown so that operators updating requests assigned to them can edit the fields shown by double clicking on them. This page was automatically sorted by ascending order of EngagementID, or rather ascending order of being created. Since this was not convenient to most people who like to see the latest at the top, I edited the page to sort the ConfiForms TableView Macro with the conidtion "EngagementID DESC" in the box below "Ordering/Sorting rules to apply on entries dataset". This was working fine until the number of rows increased to more than 1999. Now EngagementID # 1999 is at the top, sorted until EngagementID 1000 and them we have 2006, 2-005, 2004 and so on. By clicking on the EngagementID column twice shows it from 2006, 2005, ... 2001, 2000, 1999, ... as I want it to normally show.

Is there something I am missing which prevents it from showing this normally?

My confluence version is 7.19.0 (GUI6.2023-01-27.04:46: 3d6bd134)


Answers:
author: Alex Medved _ConfiForms_
body: Hi

I think you are affected by one bug we have fixed some time ago - could you check what version of **ConfiForms** app you are using?

As this is the demo on how this works now

<http://recordit.co/0wA7RTy06d>

I dont see any misbehaviour

Alex

comments: author: Satyajit Shukre
body: Yes, the video you have shared seems to be working fine. Was this a known bug? For me the 2000-2009 are being shown in between 1100 and 1102 (it starts from 1100).

Do you know how I can find the version of Confiforms app I am using? I could find only the Confluence version.

Could you guide me on how to find the Confiforms app version?


author: Satyajit Shukre
body: As per our Confluence administrator, the currently installed Confiforms version is 3.1.1 - released 27-Jan-2023. Could you let us know when the fix for the bug was available?

Thanks!


author: Alex Medved _ConfiForms_
body: Hi

That is some quite recent version and I can confirm this bug was resolved long time before this version

Feel free to [open a support ticket with us directly](https://wiki.vertuna.com/display/VERTUNA/Support+Request+Form), so we can have a look together at your data and form configuration to see what fails to sort the data as numeric values (usually it does so when the data is inconsistent and cannot be sorted as numeric as falls back to sort as text values)

Alex


author: Satyajit Shukre
body: Sure, before raising a request, I would like to mention that it is an Autonumber, but it has a prefix. Does that mean it will be treated as text?


author: Satyajit Shukre
body: Raised [SUPPORT-4610](https://vrt.atlassian.net/servicedesk/customer/portal/2/SUPPORT-4610) support issue as advised.

Thanks!


author: Alex Medved _ConfiForms_
body: Hi

Obviously a field that is not numeric will be treated as a non-numeric

Which explains why it sorts your records like your have mentioned, as text values

Consider changing your sorting expression to use internal recordId field

```
recordId DESC
```

Alex


author: Satyajit Shukre
body: Perfect! This worked!

```
recordId DESC??
```


Tags: automation

cloud

confiforms

sort