Display Reference Variable as a drop-down list

alexcolbert
Kilo Guru

Hi Community,

 

I am trying to display a Reference variable as a drop down list.

 

I have added "ref_auto_completer=AJAXReferenceChoice" to the variable attributes but it still shows the magnifying glass:

find_real_file.png

find_real_file.png

Am i missing something obvious?

 

(note: I've tried using the lookup select box type, but it doesn't seem to offer the same functionality as a reference type)

 

Thanks!

 

Alex

1 ACCEPTED SOLUTION

Yeah, there is no dot walking in lookup select box. 

If there is just one variable that you need from the user, like just the email then you can make use of the '' and get the value.

View solution in original post

5 REPLIES 5

Harsh Vardhan
Giga Patron

reference type field always give you option to select the value but not as drop down, if you will select the look select box then you can choose the table there and it will show the value as drop down 

rad2
Mega Sage

Hello,

try using - ref_auto_completer=AJAXReferenceCompleter

for more information - https://docs.servicenow.com/bundle/london-platform-administration/page/administer/field-administrati...

it would look like below

find_real_file.png

 

However, it would be better to use a lookup select box type

Thanks for your answers.

 

I guess i was just hoping that I could replicate the functionality you get outside of the service catalog.  For example if I go to the incident form, I can set the 'Choice' field on a Reference field and then this will turn it into a dropdown menu:

find_real_file.png

find_real_file.png

 

The issue i have with the lookup select box variable type, is that it is not simple to pull values from the option I select. 

For example, if I have a lookup select box for the user table, then I have to do a glide record lookup if I want to pull the value of the user's email address.  When doing the glide record I am also unable to match up based on the sys id.  With a reference field I don't have to do a glide record at all, I can effectively dot walk down to the field that I want.

 

So in short, I'm asking for the functionality of a reference field, with the user friendly look of a drop down menu :-).

 

I'll have to go with the lookup select box for now but I might raise this as an enhancement request with ServiceNow.

 

 

Yeah, there is no dot walking in lookup select box. 

If there is just one variable that you need from the user, like just the email then you can make use of the '' and get the value.