Get all variables by client script : Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2018 08:39 AM
Dear community,
Is there any function same as g_form.getEditableFields() for Portal?
I want to get the list of all variables in Service catalog in portal.
Thanks in advance 🙂
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2018 09:05 AM
Hi David,
I don't think there is any function which would give you this what we get on table form.
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
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
06-11-2018 09:31 AM
I agree with this. Otherwise, check out:
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2018 08:21 PM
I found the solution:
// get all field name 🙂
var allFields = g_form.getFieldNames();
for(i = 0; i < allFields.length; i++) {
//do something with allFields[i]);
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2020 09:06 AM
Sweet. Works like a charm still. (version: New York)