We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Get all variables by client script : Service Catalog

David Vu1
Kilo Expert

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 🙂

9 REPLIES 9

Ankur Bawiskar
Tera Patron

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

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

I agree with this. Otherwise, check out:

https://docs.servicenow.com/bundle/istanbul-servicenow-platform/page/build/service-portal/concept/va...


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

David Vu1
Kilo Expert

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]);
}
}

Sweet.  Works like a charm still.  (version: New York)