how to get all variables on the form in client side script \ UI policy?

snagarajan
Tera Contributor

how to get all variables on the form in client-side script \ UI policy? I have tried using getfieldnames() and geteditablefields() both not working. I need to hide empty variables in the requested item.

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@snagarajan 

I created blog for this in past and it has worked, you can check that enhance as per your requirement

Hide empty variables on RITM and TASK record 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

@snagarajan 

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.

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

sejal1107
Tera Guru

Hi @snagarajan 

 

var fields = g_form.getEditableFields();
this should help you to get all editable fields in form.
 
 
Please check and Mark Helpful and Correct if it really helped you.
Thanks & Regards
Sejal Chavan