- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2024 12:25 AM - edited 04-08-2024 12:26 AM
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2024 05:34 AM
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();
}
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>
Outputs: -
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2024 01:24 AM
Hi @Or Kalev2,
checkout this
https://www.servicenow.com/community/developer-forum/how-to-pass-data-from-a-ui-action-to-a-ui-page/...
Please hit helpful and accept this as a solution if it solved your problem.
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2024 01:45 AM
I saw the post, I got an error that g_scratchpad is not define
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2024 01:50 AM
Check this UI Action and how they have defined the g_scratchpad variable and access that in UI Page
Please hit helpful and accept this as a solution if it solved your problem.
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2024 02:07 AM - edited 04-08-2024 02:08 AM
The code of the UI Page should be at the Client Script part of the UI Action?
Because I get an error.