How to call a portal page in the backend

vidhya_mouli
Tera Sage

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?

 

1 ACCEPTED SOLUTION

Nawal Singh
Tera Guru

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- 

NawalSingh_0-1765207984015.png

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-

 

NawalSingh_1-1765208085037.png

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- 

NawalSingh_2-1765208215925.png

 

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

 

 

 

View solution in original post

6 REPLIES 6

kaushal_snow
Giga Sage

@vidhya_mouli ,

 

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.

 

Thanks and Regards,
Kaushal Kumar Jha - ServiceNow Technical Consultant - ServiceNow Class of Legends 2025

Ankur Bawiskar
Tera Patron
Tera Patron

@vidhya_mouli 

Sorry didn't get your requirement

both the codes are different which you shared

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Nawal Singh
Tera Guru

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- 

NawalSingh_0-1765207984015.png

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-

 

NawalSingh_1-1765208085037.png

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- 

NawalSingh_2-1765208215925.png

 

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

 

 

 

This worked. Thank you