'Lookup Select Box' variable with 'sys_user' lookup table

Simona6
Tera Contributor

For service Catalog

Using 'Lookup select Box' variable to insert user name from table 'sys_user' , it show limited number of records as user count is too high.

My Requirement:

1)Want the usernam1 field in drop down format only

2)Is it possible to show username with email id in drop down.

3)Can i put condition that user having company name 'comp1' or 'comp2' should be visible for username1 field. 

1 ACCEPTED SOLUTION

Mike Patel
Tera Sage

#1 - Yes, It's dropdown only. It's better if you change it to reference field.

#2 - you can add below to variable attributes on your variable

ref_auto_completer=AJAXTableCompleter,ref_ac_columns=email,ref_ac_columns_search=true,ref_ac_order_by=name

#3 - Once you change the variable type to reference you should be able to see filters and add your condition.

If you still want to use Lookup select box than you need to add something like below to ref equl

company.name=comp1^ORcompany.name=comp2 

 

View solution in original post

9 REPLIES 9

Than use attribute and on label field just have name as value

Can you explain this code as it's not giving expected output and what changes it make to put label field as value

ref_auto_completer=AJAXTableCompleter,ref_ac_columns=email,ref_ac_columns_search=true,ref_ac_order_by=name

find_real_file.png

find_real_file.png

Can you share screenshot of what do you see when you start typing in lookup variable.

Docs for code - https://docs.servicenow.com/bundle/orlando-platform-administration/page/administer/field-administrat...

If you want same as reference than it is not possible on lookup select box. 

Mike,

 

for variable attributes-ref_auto_completer=AJAXTableCompleter,ref_ac_columns=user_name;company,ref_ac_columns_search=true,ref_ac_order_by=company

Lookup from table=sys_user

Lookup value field-user ID

Output I am getting i.e only user ID not user_name with company

Simona6
Tera Contributor

variable attribute only work if i will select variable reference field type.