How to find which field/variable are avaliable on catalog form at Service Portal using client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2025 09:29 AM - edited ‎01-06-2025 09:29 AM
Hi All,
I have requirement to update only the variable/fields available on the form at service portal and not RITM/SCTASK.
but I am unable to get that information in catalog client script as g_form.getFieldNames() or g_form.isVisible() methods are not available/deprecated in Xanadu version.
So can you please help me or guide me how I can get the fields names that are available in current form through client Script.
Thank you in advance.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2025 05:42 AM
Hi All,
Thanks to all the inputs provided which indeed helped me.
The below script is able to find the fields that are visible on the form in Service portal level on load, but it won't be able to provide you the field details if it is made visible based on selection of another variable. i.e lets says "field4" will be visible when "field3" is selected as "Yes" then the below script won't return field4.
Attaching the screenshot of output
Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2025 06:03 AM
but this doesn't solve your requirement.
I already informed you cannot determine that.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2025 07:50 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader