Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

What is the alternate for gel() in client script

ramesh_r
Giga Sage

Hi All,

 

I have the client script with the gel() method but I want to replace gel() with something else.

Please help me with an alternate for gel() in the client script

Sample Line below:

var name = gel('service_select_0'));

 

Thanks

 

 

7 REPLIES 7

There's not a 1 on 1 replacement. You really have to look at the individual cases, what your developers have setup, what the functionality is, if you can rebuild such, or that you have to abandon the functionality, etcetera.

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Probably the first time I am seeing anyone use etcetera and not just etc. 🙂

-Anurag

You are looking to find alternate of gel(), which is not recommended, basically DOM manipulation is not recommended, so any alternate you use for the same, it will still not be a good practice.

For eg, stealing is bad, what is the alternate - There is no alternate just don't steal.

 

As Mark rightly said, depends on the case what you are trying to do , in many cases you can find an OOB api for the same, eg to show / hide fields, field styles, field behavior , all these can be done in javascript using get() but servicenow has alternate functions to control this in g_form api.

-Anurag