Pass params from UI Action to UI Page

Or Kalev2
Tera Contributor

Hi all,
I have a UI action that calls UI Page. 
I used the new GlideDialogWindows to render the UI Page as popup

 

function PopUIPage(){
	var sysIds = g_list.getChecked();
	var gdw = new GlideDialogWindow('ui_page');
	gdw.setSize(750,300);
	gdw.setPreference("sys_ids", sysIds);
	gdw.render();
}

 

 
Then I try to get the 'sys_ids' on the UI Page. 
Where I can get them? At the HTML? Client Script? I try every thing without any success. 
Thanks.  

1 ACCEPTED SOLUTION

AakashG2703
Mega Guru

Hi @Or Kalev2,

Hope you are doing well.

 

Proposed Solution

In order to achieve this task, I personally tried it on my "Personal Developer Instance" so that you can get the solution as soon as possible. For this, you just need to get all the "Sys IDs" in "HTML/XML Section" of your "UI Page" to get your query resolved. Attaching my Scripts and some snapshots of the outputs for your reference mentioned below: -

 

UI Action: -

function confirmAction() {
    var sysIds = g_list.getChecked();
    alert(sysIds);
    var dialog = new GlideDialogWindow('incident_details');
    dialog.setTitle('Incident Details');
    dialog.setSize(550, 200); // consists of Height and Width
    dialog.setPreference('sysparm_sysid', sysIds);
    dialog.render();
}

AakashG2703_1-1712579477194.png

 

UI Page: -

<?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="jvar_sysid" expression="RP.getWindowProperties().get('sysparm_sysid')" />
<p>${jvar_sysid}</p>
</j:jelly>

AakashG2703_0-1712579412705.png

 

Outputs: -

AakashG2703_3-1712579563207.png

AakashG2703_4-1712579590206.png

 

 

If you find this information/knowledge/solution helpful, please don't forget to mark my solution and reply as helpful and accepted.

 

Thanks ‌‌:)

Aakash Garg

ServiceNow Developer

View solution in original post

7 REPLIES 7

UI Action

OrKalev2_1-1712567497575.png


UI Page - Client Script

OrKalev2_2-1712567512854.png

 

AakashG2703
Mega Guru

Hi @Or Kalev2,

Hope you are doing well.

 

Proposed Solution

In order to achieve this task, I personally tried it on my "Personal Developer Instance" so that you can get the solution as soon as possible. For this, you just need to get all the "Sys IDs" in "HTML/XML Section" of your "UI Page" to get your query resolved. Attaching my Scripts and some snapshots of the outputs for your reference mentioned below: -

 

UI Action: -

function confirmAction() {
    var sysIds = g_list.getChecked();
    alert(sysIds);
    var dialog = new GlideDialogWindow('incident_details');
    dialog.setTitle('Incident Details');
    dialog.setSize(550, 200); // consists of Height and Width
    dialog.setPreference('sysparm_sysid', sysIds);
    dialog.render();
}

AakashG2703_1-1712579477194.png

 

UI Page: -

<?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="jvar_sysid" expression="RP.getWindowProperties().get('sysparm_sysid')" />
<p>${jvar_sysid}</p>
</j:jelly>

AakashG2703_0-1712579412705.png

 

Outputs: -

AakashG2703_3-1712579563207.png

AakashG2703_4-1712579590206.png

 

 

If you find this information/knowledge/solution helpful, please don't forget to mark my solution and reply as helpful and accepted.

 

Thanks ‌‌:)

Aakash Garg

ServiceNow Developer

saitejaSnow
Tera Contributor

Hi kalev2,

please use the below process,

UI page:  

to get you parameter in UI page

<g2:evaluate var="jvar_sys_ids" object="true" jelly="true">
jelly.sys_ids;
</g2:evaluate