I am trying query list in workflow, to get the record having the maximum value , the field is a single line text field.
The normal descending and ascending is not working. Getting the below sequence. Tried the collection sort also., didn't work
Is there a way to sort it like
since the list field is of type text they are sorted as strings not as numbers.
if you are sure the field can contain just numbers can you change its type to numeric?
if not, as a workaround you could create a calculated list field being equal to this text field but having numeric type. then make query/sort/filter by this calculated field.
I can't change the data type to numeric due to some reason.
I tried creating the calculated field with numeric type and even that did not work.
Finally end up with looping through the collection to find the greatest number (well the idea was to get the greatest number)