Get the URL parameter on ui page

Akihiro
Tera Contributor

I want to transfer some values on form to ui page. So that I'm thinking about implementing UI action that gets some values on form and set these values on url and opens UI Page.

Now I'm trying to get url values and set these values on the UI Page. So that I use following Module and UI Page. But I can't use "RP.getParameterValue()" method to get url parameter. 

Please tell me the way to get url parameter on ui page.

[Module Description]

Arguments:https://(instance_id).service-now.com/ui_page.do?sys_id=(sys_id)&sysparm_id2=111111111

[UI Page Description]

HTML:

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate var="sysparm_id2">
var sysparm_id2 = RP.getParameterValue('sysparm_id2');
sysparm_id2;
</g:evaluate>
<g:ui_form>
<input type="text" name="myparam" value="${sysparm_id2}" />
<button type="submit" name="search" value="search">serch</button>
</g:ui_form>
</j:jelly>

 
6 REPLIES 6

Michael Jones -
Giga Sage

Maybe I'm missing something, but shouldn't this line: 

<input type="text" name="myparam" value="${sysparm_id2}" />

Be this?

<input type="text" name="myparam" value="${sysparm_id}" />

That seems to work for me: 

find_real_file.png

I hope this helps!

If this was helpful, or correct, please be kind and mark the answer appropriately.

Michael Jones - Proud member of the GlideFast Consulting Team!

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

Thanks for answering!

Sorry I mistook the UI Page's script. I'm sorry for answering.

I could get the parameter 'sys_id' but I couldn't get parameter 'sysparm_id2'.

I'm sorry for answering you.

[HTML (after changed)]

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate var="sysparm_id2">
var sysparm_id2 = RP.getParameterValue('sysparm_id2');
sysparm_id2;
</g:evaluate>
<g:ui_form>
<input type="text" name="myparam" value="${sysparm_id2}" />
<button type="submit" name="search" value="search">serch</button>
</g:ui_form>
</j:jelly>

 

Best regards.

I assume them you no longer need assistance?

It looks to me like your code should be working; at lease it seems to be work for me. 

find_real_file.pngfind_real_file.png

Regards, 

Michael Jones - Proud member of the GlideFast Consulting Team!

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

Thanks for answering! I see. 

Lastly, let me ask you one more question.

Can you get multiple url parameters?

Best regards.