Can i add an "Order" filed in custom lookup data table ?

yandp
Tera Guru

Hi all, 
in my custom application some field are using reference field to the custom lookup data .

 

yandp_0-1689575664537.png

Can i add an order field in custom lookup table and use that to sort the keywords list retrieved from the custom lookup data?

If yes, please share how to do else any other method to achieve this?

Thank you so much.

1 ACCEPTED SOLUTION

Arun_S1
Tera Guru
Tera Guru

@yandp you meant to say that some of the OOTB tables like Business Rules, UI Policies contain an order field. You would like to add a similar field in your custom table is it?

 

You can add the order field in the lookup table and add "ref_ac_order_by=u_order" in your variable attributes field, this will take care of the ordering part.

 

Note: u_order is my custom field, please change in case you have a different field.

 

Arun_S1_0-1689577342766.png

 

 

 

Please mark the appropriate response as correct answer and helpful.

Thanks!!

View solution in original post

5 REPLIES 5

Sagar Pagar
Tera Patron

Hi @yandp,

 

Yes. you can add the order/ sequence field or column. You can use it in reference qualifier to sort it ascending or descending order.

 

Qualifier:

 

^ORDERBYu_order;

 

^ORDERBYDESCu_order;

 

Thanks,

Sagar Pagar

The world works with ServiceNow

Arun_S1
Tera Guru
Tera Guru

@yandp you meant to say that some of the OOTB tables like Business Rules, UI Policies contain an order field. You would like to add a similar field in your custom table is it?

 

You can add the order field in the lookup table and add "ref_ac_order_by=u_order" in your variable attributes field, this will take care of the ordering part.

 

Note: u_order is my custom field, please change in case you have a different field.

 

Arun_S1_0-1689577342766.png

 

 

 

Please mark the appropriate response as correct answer and helpful.

Thanks!!

Hi @Arun_S1 , 

Thank you so much for the help, after adding as your suggestion, it is now working in record producer.
what about in the platform, how to have the sorting based on the order also?

Thank you.

yandp_0-1689728533573.png

 

@yandp Please see the screenshot below, please add the attribute "Reference auto completer order by" attribute on the reference field and the value should contain the order field name "u_order".

 

Arun_S1_0-1689760454032.png

 

Arun_S1_1-1689760616075.png

 

 

Please mark the appropriate response as correct answer and helpful.

Thanks!!