how to get Parameter from URL in Jelly Script

Jiang Yang
Tera Contributor

Hello,

I am trying to get parameter from the URL in Jelly Script

URL - https://xxxxxx.service-now.com/nav_to.do?uri=%2F$pa_dashboard.do%3Fsysparm_dashboard%3De59a38708701011068c6ca280cbb355a%26params_requester%3D3a8965143b1c445052ca655593efc4e6

I have tried the below code

<g:evaluate var="jvar_wbsid">
var value = RP.getParameterValue('params_requester');
value;
</g:evaluate>
<g:ui_reference name="QUERY:active=true" value = "${jvar_wbsid}" id="assigned_to" table="sys_user" />
<span>${jvar_wbsid}</span>

 

Result :

null

 

This works when i try to get sys_id but returns blank when used for params_requester

Is there any way to get it work for other parameters?

17 REPLIES 17

I try to use gs.action.getGlideURI(),

I got below value.

 

angular.do?additionalSysParm=%7b%22sysparm_homepage_filters%22%3a%5b%5d%7d&canvasSysId=eccab4708701011068c6ca280cbb3549&method=getWidgetsContent&selectedItems=%5b%7b%22sysId%22%3a%22619715808747411068c6ca280cbb3580%22%2c%22uuid%22%3a%229b6572c3-00b9-4f03-8bf6-0e6d8dc85065%22%7d%2c%7b%22sysId%22%3a%221a0bd1b787f6011068c6ca280cbb3500%22%2c%22uuid%22%3a%22ed521e19-1403-48ee-8528-6f11f51f3b31%22%7d%2c%7b%22sysId%22%3a%222b2c5f9a8736411068c6ca280cbb35f5%22%2c%22uuid%22%3a%228540d9af-0bfd-4c21-8e1a-d440671b4d6b%22%7d%5d&sysparm_type=canvasProcessor

so it means the url is not having that parameter or the correct URL is not being fetched

Can you share how that dashboard is being rendered?

Regards
Ankur

 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

UI action script:

var code = current.u_requester;
gs.setRedirect("$pa_dashboard.do?sysparm_dashboard=e59a38708701011068c6ca280cbb355a&params_requester=" + code);

Hi,

please share the dashboard configuration and the script screenshot

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

dashboard

find_real_file.png

content block :

find_real_file.png