How to Configure Reference Variable to Sort by a Column

kshaw
Giga Guru

I have created a service catalog item.

One variable is of type reference, pointing to a custom table.

On that table there are 2 values I want to use to present a visible list of a 3rd column.

  • Active = true  (field on custom table = Active true or false) - filter list by true
  • Sort = field on custom table numbered sequencially (sort ascending)
  • Case Number - displayed field from custom table

Reference Variable.png

 

I have also tried different Advanced Reference qual with "javascript: 'ORDERBYu_sort^u_cat_active=true'' working on same custom table as a Lookup Select Box variable type BUT does not work on the reference variable type.

I could use Lookup Select Box but I need that to be a link to the record in a list (need to get sys_id of case number)

 

In the image below, this is what is being displayed with current configuration, red numbers are the order the values should be in with header at top, spacer, then ascending active case number. (sort numbering column)

 

sort.png

 How can I get this list to sort properly on a reference field?

 

2 REPLIES 2

R_52
Tera Guru

@kshaw  did you get any solution?

Yes I did, on the Variable form page go to Type Specifications tab.

Reference qual = javascript: 'u_cat_active=true^ORDERBYDESCcat_leave_case'

Changed field reference from original post but got desired result.

Reference list is filtered by active field and then sorted in descending order by another field.

 

RefQual.png