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.

How to read the value from UI page URL

Sagaya1
Giga Expert

Hi,

I am developing the UI page and need to read the value from UI page URL , but unable to read the value . Please help to resolve this issue.

:URL : https://<instance>.service-now.com/close_case.do?sys_id=b30dd5b5db4b10108a705baed39619ca

HTML code :
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:ui_form>
<g:evaluate var="jvar_sysid" expression ="RP.getWindowProperties().get('sys_id')" />
</g:ui_form>
</j:jelly>

Client  script code :
var sysId = gel('task_sys_id').value;
alert("sysId=" + sysId);

output :

find_real_file.png

Regards,

Sagaya.

 

1 ACCEPTED SOLUTION

Narasimhulu
Giga Contributor

Hi sagaya,

Good Morning,

 

below link is working fine for me, you can use the same.

 

<g:evaluate var="jvar_sysid" expression ="RP.getParameterValue('sys_id')" />

 

Regards

Narasi

View solution in original post

4 REPLIES 4

Mike Patel
Tera Sage

try

<g:evaluate var="jvar_sysid" expression ="RP.getParameterValue('sys_id')" /> 

Narasimhulu
Giga Contributor

Hi sagaya,

Good Morning,

 

below link is working fine for me, you can use the same.

 

<g:evaluate var="jvar_sysid" expression ="RP.getParameterValue('sys_id')" />

 

Regards

Narasi

Hi Narasi ,

It's working now . Thank you very much for your help .

 

Regards,

Sagaya.

Hi,

What will be the case if there is another parameter along with sys_id.

Ex: URL : https://<instance>.service-now.com/close_case.do?sys_id=b30dd5b5db4b10108a705baed39619ca&second_param=test

I need to read the ''second_param" value in the UI Page Jelly code(not client script). I have checked by using RP.getParameters() and the second parameter is not even available.

Thanks in Advance!!