Need to get all options from a field (lookup selectbox) on load of form

R Akash
Kilo Expert

Hello 

I have a field(lookup select box) which is referred to topic category table. i have reference qualifier which will bring categories based on some logic. we are showing only unique categories here. Is there anyway i can get all options of the field on load of form. I tried getoption method but looks like it will not work in portal.

 

 

Thanks

Akash 

8 REPLIES 8

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Can you share your screenshot of the field configuration?

didn't get this part -> get all options of the field on load of form

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hello Ankur

find the image of field configuration. Reference qualifier returns categories and we are showing only unique ones by making unique values only checkbox true. I need to get all those unique options in onload client script.

find_real_file.png

 

Hi,

you will have to script it using onLoad client script + GlideAjax

Apply the same filter as encoded query in script include and return the options

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur

i am using catalog client script. In my scenario when user clicks on content item it will redirect to the form and i need to populate category. i am sending sysid through URL Parameter. but i have same category name in different COES with different sysids.

for example

i am having category ABC in payroll, performance, total reward tables but sys id are different. On load of form it randomly picking up any one of them due to unique checkbox is true. so i am not able to set sysid. if i get all unique options present in that field on load i can compare that with url parameter and i can set.

 

 

Thanks

Akash