Reference Field : How to sort the results in descending order using reference qualifier?

kutvaram
Tera Expert

Hi All,

I have a variable of reference field type with simple condition in it.

I need to sort the results by a column in descending order.

I used variable attributes section where ref_ac_order_by=columnname.

This is doing ascending order sorting.

How to do it descending order sorting by a column name?

I have referred many community links and also got to know , have to write query business rule. But I am not happy with that.

Kindly advise using variable attributes sorting by descending or a better way.

Thanks,

Ram Prakash K R

1 ACCEPTED SOLUTION

Can you try like this

var encodedquery = "sys_created_on>=2020-12-14^sys_created_on<=2020-12-15 23:59:59";

Thanks,

Narsing

View solution in original post

22 REPLIES 22

Hi Narsing,

I tried the above suggestion and it worked.

Thanks a lot 🙂

Its a great help!

Thanks,

Ram Prakash K R

Sagar Pagar
Tera Patron

Hello Ram,

 

Try ORDERBY or ORDERBYDESC in advanced reference qualifier. It will give you expected result.

javascript:'filter_query^ORDERBYcolumnName';

OR

javascript:'filter_query^ORDERBYDESCcolumnName';

For example:

javascript:'active=true^ORDERBYname';

 

Regards,

Sagar Pagar

The world works with ServiceNow

Hi Sagar,

It is not working.

Thanks,

Ram Prakash K R