Need to get all options from a field (lookup selectbox) on load of form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 09:41 PM
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
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 09:44 PM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 09:57 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 10:03 PM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 10:07 PM
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