- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I have a UI button with the following code in the client_script_v2
function onClick(g_form) {
g_modal.showFrame({
title: 'Select users to send the survey',
url: '/nothemeportal?id=bulk_send_onboarding_survey&workspace=true&sys_id=' + g_form.getValue('request_item'),
size: 'xl',
height: 500,
hasLoadingMessage: true,
autoCloseOn: 'URL_CHANGED'
});
}
Right now in the script i am calling a UI page which does exactly the same things the widget does in the portal page
function sendSurvey() {
var dialog = new GlideDialogWindow('customer_onboarding_send_survey'); //Ui Page
dialog.setTitle('Select Options');
dialog.setWidth(400);
dialog.setPreference('sysparm_reqItemSysID', g_form.getValue('request_item'));
dialog.render();
}
I want to avoid the duplication and call the portal page in the backend too (not in the workspace but directly in the table - form). How can I do this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @vidhya_mouli ,
I have did similar requirement in my pdi , please review below points-
1. Created UI action Button- (In incident form)- Checklist- for example and i'm calling Ui page using Glide Model here is the screenshot and code-
Example Code-
function openShow(){
var id= g_form.getUniqueValue();
var dialog = new GlideModal("nksmwidgetcalling");
dialog.setTitle('Audit test');
dialog.setPreference("sysparam_id", id);
dialog.setPreference("sysparam_page" ,"testpage");
dialog.setBackdropStatic(true);
dialog.render();
}
2. Ui Page screenshot and code-
Code-
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<j:set var="jvar_pref" value="${sysparam_id}" />
<j:set var="jvar_page" value="${sysparam_page}" />
<div>
<iframe id="test" src="ithub?id=testpage" width="550" height="550"></iframe>
</div>
</j:jelly>Here i'm calling portal page to show in my model when user clicked on the ui action button
3 Output screenshot-
In this way you can call portal pages and it;s widget in backend as per your requirement
Hope this will help you !!
If you found my response helpful, please mark it as helpful and accept it as the solution.
Thank you
Nawal Singh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
You can’t reliably call a portal page/widget from the backend UI because portal widgets run in a different engine (Angular/ServicePortal).......the platform UI dialog APIs (like GlideDialogWindow / GlideModal ) won’t reliably embed a portal widget so that it can interact with the form.......
If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.
Kaushal Kumar Jha - ServiceNow Technical Consultant - ServiceNow Class of Legends 2025
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Sorry didn't get your requirement
both the codes are different which you shared
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @vidhya_mouli ,
I have did similar requirement in my pdi , please review below points-
1. Created UI action Button- (In incident form)- Checklist- for example and i'm calling Ui page using Glide Model here is the screenshot and code-
Example Code-
function openShow(){
var id= g_form.getUniqueValue();
var dialog = new GlideModal("nksmwidgetcalling");
dialog.setTitle('Audit test');
dialog.setPreference("sysparam_id", id);
dialog.setPreference("sysparam_page" ,"testpage");
dialog.setBackdropStatic(true);
dialog.render();
}
2. Ui Page screenshot and code-
Code-
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<j:set var="jvar_pref" value="${sysparam_id}" />
<j:set var="jvar_page" value="${sysparam_page}" />
<div>
<iframe id="test" src="ithub?id=testpage" width="550" height="550"></iframe>
</div>
</j:jelly>Here i'm calling portal page to show in my model when user clicked on the ui action button
3 Output screenshot-
In this way you can call portal pages and it;s widget in backend as per your requirement
Hope this will help you !!
If you found my response helpful, please mark it as helpful and accept it as the solution.
Thank you
Nawal Singh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
This worked. Thank you