Passing a Parameter through url to Query in UI Page

sami_siddiqui
Kilo Explorer

Hi,

While calling a UI Page through UI Action how can I pass a parameter to below line in UI Page.I have a UI page to display po header with line items and I would like to know how can I pass the current PO number to retrieve the data for that particular po.

gr.addQuery ('number','=','parameter_from_url');

Any help in this regard will be highly appreciated.

Thanks,

Sami.

1 ACCEPTED SOLUTION

Makosko
Tera Expert

Here we go...



assume the following is your url:


https://instance.service-now.com/ui_page.do?sysparm_id=6e1e02ac4d3c5d00407eccb253aa2b13



Retrieve Parameter Value from within a UI page:


<g:evaluate var="sysparm_id">


          var sysparm_id = RP.getParameterValue("sysparm_id"); -> here you specify the name of your parameter !


                    sysparm_id;


</g:evaluate>



Use parameter in your script:


<g:evaluate var="jvar_user" object="true" jelly="true">


                var gr = new GlideRecord("sys_user");


                          gr.get(jelly.sysparm_id);


                          gr;


</g:evaluate>


View solution in original post

8 REPLIES 8

Many thanks Makosko for the help,yes it worked fine



Sami.


Hi Sam,


Did you later write a client script to set the value that you got?


Hello, i am searching to pass values in url and to store it in a table. where do i need to use these codes.. In Business rule ?


Hi All,



This is a jelly scripting written in detail template of Content type of content management module.


On click of the 'OK', it redirects to a test screen where it is supposed to populate the value in a field. I am getting the sysid in the url.


How to pass the value of the record to a field(which is a reference field) in Test Page. So like we if clik on abc1 record, then id field of Test should show abc1.



Do I need to write a client script to take the sysid from the url and set the value of a field. If so, then how to achieve that?


find_real_file.png


Any help in this regard will be appreciated.



Thanks


Surya