Jelly Script get Parameter from URL

rad2
Mega Sage

Hello,

I am trying to get parameter from the URL in UI pages.

URL - https://xxxxxx.service-now.com/incident.do?sys_id=-1&sys_is_list=true&sys_is_related_list=true&sys_target=incident

I have tried the below code

<g:evaluate var="jvar_sys">
    var sysparm_id = RP.getParameterValue("sys_target") + "";
    sysparm_id;
</g:evaluate>


<span>${jvar_sys}</span>

 

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

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

 

1 ACCEPTED SOLUTION

Hi,

then this should work fine

<g:evaluate var="jvar_sys" jelly="true" object="true">
    var sysparm_id = gs.action.getGlideURI().getMap().get('sys_target');
    sysparm_id;
</g:evaluate>

Regards
Ankur

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

View solution in original post

15 REPLIES 15

Bala Krishna2
Mega Guru
Mega Guru

Can you try through GlideURL?

action.getURLParameter('sysparm_query');

I think this works for UI actions

i was wrong 🙂

getGlideURI()

worked

Ankush Jangle1
Kilo Guru

Hello,

This thread may help you

Link1

 

Please mark it as helpful/Correct if it helps you