How to Stop showing Service Acc. starts as number, i just want to show the actual User in AtoZ order

Anuj30
Tera Contributor


we have a field requested by in catalog item, which which shows user account in catalog item .

Now there are lots of service Account which starts from 0, 1, 2 and FYI.

so i just want to stop showing these account in this field, it will be better if user list will reflect in A to Z order. so that the service account with number will reflect down in that list

 

I have already tried the ''ref_ac_order_by=name'' in Variable Attributes in variable, but it is not working.

 

How it will reflect in A to Z order ? Screenshot Attached

1 ACCEPTED SOLUTION

ChallaR
Giga Guru

Hi  ,

If those are service accounts and should not be selectable, use a Reference qualifier on the catalog variable.

If the variable points to sys_user, add a qualifier like:

 
expl-active=true^user_nameNOT LIKE0^user_nameNOT LIKE1^user_nameNOT LIKE2^user_nameNOT LIKEFYI​
Or if you want to block all accounts starting with numbers, better use an Advanced reference qualifier script.
javascript:'active=true^user_nameNOT LIKE0^user_nameNOT LIKE1^user_nameNOT LIKE2^user_nameNOT LIKE3^user_nameNOT LIKE4^user_nameNOT LIKE5^user_nameNOT LIKE6^user_nameNOT LIKE7^user_nameNOT LIKE8^user_nameNOT LIKE9^user_nameNOT STARTSWITHFYI'

 

else 

If you want users shown in A–Z by name, then use:
ref_ac_order_by=name

 

or if your actual display should be by full name / first name / last name, use the correct field:
ref_ac_order_by=first_name or
ref_ac_order_by=last_name
 
 
You cannot push number-based accounts below A–Z just by ref_ac_order_by.
Because sorting always puts numbers before alphabets.
  • Exclude service accounts using Reference qualifier
  • Keep sorting with:
    ref_auto_completer=AJAXTableCompleter,ref_ac_order_by=name
     
    Thanks,
    Rithika.ch

 

View solution in original post

2 REPLIES 2

ChallaR
Giga Guru

Hi  ,

If those are service accounts and should not be selectable, use a Reference qualifier on the catalog variable.

If the variable points to sys_user, add a qualifier like:

 
expl-active=true^user_nameNOT LIKE0^user_nameNOT LIKE1^user_nameNOT LIKE2^user_nameNOT LIKEFYI​
Or if you want to block all accounts starting with numbers, better use an Advanced reference qualifier script.
javascript:'active=true^user_nameNOT LIKE0^user_nameNOT LIKE1^user_nameNOT LIKE2^user_nameNOT LIKE3^user_nameNOT LIKE4^user_nameNOT LIKE5^user_nameNOT LIKE6^user_nameNOT LIKE7^user_nameNOT LIKE8^user_nameNOT LIKE9^user_nameNOT STARTSWITHFYI'

 

else 

If you want users shown in A–Z by name, then use:
ref_ac_order_by=name

 

or if your actual display should be by full name / first name / last name, use the correct field:
ref_ac_order_by=first_name or
ref_ac_order_by=last_name
 
 
You cannot push number-based accounts below A–Z just by ref_ac_order_by.
Because sorting always puts numbers before alphabets.
  • Exclude service accounts using Reference qualifier
  • Keep sorting with:
    ref_auto_completer=AJAXTableCompleter,ref_ac_order_by=name
     
    Thanks,
    Rithika.ch

 

Tanushree Maiti
Tera Patron

Hi @Anuj30 

 

1) Refer: KB0743165 In Service Portal, reference variable does not honor the "Order" column of the referenced ... 

 

Resolution

The reference list in Service Portal can be configured to be sorted by Order column using the following steps:

  1. Navigate to the reference variable.
  2. Go to the Default Value tab.
  3. In the Variable Attributes field, add the following: ref_ac_order_by=order 
  4. Save and test on Service Portal. 

 

2)KB0535733 If you have a Reference field where you use a choice list, you cannot sort using attribute... 

Workaround

Use the attribute [ref_sequence] instead of [ref_ac_order_by].

Replace:

ref_ac_order_by=u_order


With:

ref_sequence=u_order

 

3)

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti