Redirect catalog link to employee center through servicenow virtual agent

ashutoshman
Tera Contributor

Hi 

 

When I'm raising a service request through virtual agent it's giving a catalog link which is redirecting service portal,

But the requirement is link should be redirect to employee center, Can anyone please help me on the same?

 

************Code for getting catalog item*********************

(function execute() {
function getCatalogM2M(portalId) {
var gr = new GlideRecord('m2m_sp_portal_catalog');
if (gr.isValid()) {
gr.addActiveQuery();
gr.addQuery('sp_portal', portalId);
gr.addQuery('sc_catalog.active', true);
gr.orderBy('order');
gr.orderBy('sc_catalog.active');
}
else {
gr = new GlideRecord('sp_portal');
gr.addQuery('sys_id', portalId);
}
gr.setWorkflow(false)
gr.query();
return gr;
}
var suffix = vaVars.portalName;
if (suffix) {
var catalogs = "";
var gr = new GlideRecord('sp_portal');
gr.addQuery('url_suffix', suffix);
gr.setWorkflow(false)
gr.query();
gr.next();
var portalId = gr.getUniqueValue();
vaVars.portalId = portalId;
var m2mGR = getCatalogM2M(portalId);
if (m2mGR.getRowCount() > 0) {
m2mGR.next();
catalogs += m2mGR.getValue('sc_catalog');
while (m2mGR.next()) {
catalogs += ',';
catalogs += m2mGR.getValue('sc_catalog')

}
}
return catalogs;
}
return '';
})()
5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@ashutoshman 

in that script did you try to hard-code portalId as esc?

is the above script a custom one?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Hi Ankur 

I tried hard-code as esc but its not working

Above script is OOB 

@ashutoshman 

please share how did you configure that? share screenshots

I believe you will have to create your own script for this.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Hi Ankur 

I just enable Submit a request OOB topic in service now virtual agent designer>> Duplicated that topic and published it>> We are using employee center but when I was trying to test from virtual agent It's giving service portal link but I want It should be redirected to employee center