How to create a search functionality in service now without using lookup select box

fisfreak
Kilo Contributor

Hi All,

I have the following requirement.

I want to replace the select box with a search functionality but not using a "Lookup Select box" variable type.

currently, i make some API call and get a list of VMs and append it to select box as g_form.addOption("vms", name, name); but now since the number of VM's have increased, I want to change the drop-down to search box. I could have achieved it using a Lookup select box provided I have a data coming from a database table, which is not the case.

From this :

find_real_file.png

I want this :

find_real_file.png

How do I achieve this ?? and once the above search box is ready, I need to append the result from the rest call.

Any suggestion would be appreciated.

Thanks,

Krishna P

8 REPLIES 8

Where you are creating....


I have a catalog item and want to have the search functionality there. Please read my original question.



Thanks,


Krishna P


For search functionality, there should b some data or table from where the required value will search.
so if you want to use that search functionality, its advised to use a table and store all values in that table. adding large no of values with g_form.addOption is not a good practice.


chiranjeevik
ServiceNow Employee
ServiceNow Employee

Krishna,



Can you please clarify the below:



1. Do you have the data of VM's on sn DB?if not you don't have an option to create reference field


2. My advice is to, store the data what ever you are getting from the REST/SOAP on to a temporary table with the display field as 'XYZ' < what ever you ant to see on the selection



Let me know, if you need any help.