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.

UI Page to UI Page Redirect with Multiple Parameters

raprohaska
Kilo Guru

There are a number of articles about passing a single parameter on the URL , typically in redirecting to a new record. What if I want to pass multiple parameters via the URL from UI Page 1 to Page 2?


For example:

Processing Script of Page 1

response.sendRedirect('ui_page.do?sys_id=254130cddbd5ba003d81dbd4ce9619a7&myParam=value');

Page 2

var mySysId = RP.getParameterValue('sys_id');

var myParamValue= RP.getParameterValue('myParam');

Result
mySysId = 254130cddbd5ba003d81dbd4ce9619a7
myParamValue is empty when I would expect it to be "value"

Thanks in advance for any help you can give,
AA

1 ACCEPTED SOLUTION

raprohaska
Kilo Guru

I think I finally answered my own question... well sort of anyway. I updated the redirect to use the page name instead of using the sys_id:



response.sendRedirect('page_name.do?sysparam_param1=value1&sysparam_param2=value2');



As you see I added another test parameter to make sure it could really work with multiple parameters and the values came out correctly using RP.getParameterValue


View solution in original post

1 REPLY 1

raprohaska
Kilo Guru

I think I finally answered my own question... well sort of anyway. I updated the redirect to use the page name instead of using the sys_id:



response.sendRedirect('page_name.do?sysparam_param1=value1&sysparam_param2=value2');



As you see I added another test parameter to make sure it could really work with multiple parameters and the values came out correctly using RP.getParameterValue