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.

encoded query

levino
Giga Guru

Hi there

please advise  , its calling a script include, just this part i am having trouble with on the cat item onload client script

Table sys_user_grmember

 

var thisUser = g_form.getValue("requested_for");

var encoded_query = 'group.nameSTARTSWITHlic_postman' + 'user=' + thisUser;​

 

1 ACCEPTED SOLUTION

Sandeep Rajput
Tera Patron
Tera Patron

@levino It is generally not a good practice to put GlideRecord query in the client script. Your encoded query can be fixed as follows.

 

var thisUser = g_form.getValue("requested_for");

var encoded_query = 'group.nameSTARTSWITHlic_postman' + '^user=' + thisUser;

Hope this helps.

View solution in original post

1 REPLY 1

Sandeep Rajput
Tera Patron
Tera Patron

@levino It is generally not a good practice to put GlideRecord query in the client script. Your encoded query can be fixed as follows.

 

var thisUser = g_form.getValue("requested_for");

var encoded_query = 'group.nameSTARTSWITHlic_postman' + '^user=' + thisUser;

Hope this helps.