Redirect user to a portal page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2023 08:46 AM
The requirement is like when a user has the company "xyz" then redirect them to a portal page, and do not allow them to access the backend servicenow. There is no provision of using snc_external role. Need to do it somehow via redirection when particular user loggs in.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2023 08:59 AM - edited ‎12-07-2023 09:00 AM
You need to modify the "SPEntryPage" script include to do that and define what you need, for example, for my case I needed to redirect the users depending if they had roles and redirect them to the correct portal or backend.
if (user.hasRole('admin')){
return "/?.do";
}
else if ((user.hasRole('sn_customerservice_agent') || user.hasRole('itil')) && !redirectURL && !isServicePortalURL){
return '/now/nav/ui/classic/params/target/home.do/';
}
else if (user.hasRole('sn_customerservice.customer') && !redirectURL && !isServicePortalURL) {
gs.info('ss user role');
return '/csm';
} else if (user.hasRole('sn_customerservice.consumer') && !redirectURL && !isServicePortalURL){
return '/csp';
}
else if (user.hasRoles() && !redirectURL && !isServicePortalURL) {
return "/?.do";
} else if (!user.hasRoles() && !redirectURL && !isServicePortalURL) {
return "/sp";
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2023 06:32 PM
Hi @Shusovit Dutta ,
To redirect user to a portal page, you can refer to below links which discuss the same.
https://www.servicenow.com/community/now-platform-forum/redirect-user-to-different-service-portal-ba...
https://www.servicenow.com/community/now-platform-blog/6-ways-to-set-up-your-service-portal-for-redi...
If my response helps you in assisting your requirement anyway, please mark my response as helpful or accepted solution @Shusovit Dutta .
Thanks & Regards,
S. Lakshmikanth Gupta.