Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

this.getParameter('') in script include

rishi4200
Giga Expert

Hi Experts,

Good Day !
Can someone please let me know what is the use of this.getParameter('') does in script include with an example, if possible ?

I am trying to explore GlideAjax but not able to get the use of this.getParameter('') in script include ?

Thank you in advance !

Thank you,

RIshi

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Rishi,



var usrName = this.getParameter('sysparm_user_name'); //Here sysparm_user_name will have the input received from client script i.e ga.addParam('sysparm_user_name',"Bob");



Reference:


http://wiki.servicenow.com/index.php?title=GlideAjax#gsc.tab=0


View solution in original post

6 REPLIES 6

Inactive_Us1957
Kilo Guru

This is used to get the value of that parameter which is used in client script


for example


in client script it should be written as



ga.addParam('sysparm_sysid',g_form.getUniqueValue());




here we pass a value with this parameter and in script include it should be written as this.getParameter('sysparm_sysid') to get value of it.


Here sysparm should be mandatory but we can add name with it as i shown above


harshitver3
Tera Contributor

In ServiceNow, this.getParameter() is a method primarily used within client-callable Script Includes that extend the AbstractAjaxProcessor class. This method allows you to retrieve parameters that have been passed from a client-side script (such as a Client Script) to the server-side Script Include via a GlideAjax call.