- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2022 03:55 PM
Hello,
Is it possible to redirect users with (xyz role + snc_internal) to xyz service portal (not /sp) after logging in?
Best regards,
Ruaa
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2022 06:14 PM - edited 11-30-2022 06:16 PM
1. Navigate to Script include -> Search script with the name "SPEntryPage ".
2. Open the script in detail, Find the function "getFirstPageURL".
3. Add script as image below
if (user.hasRole('xyz_role') && user.hasRole('snc_internal')) {
return '/your_portal';
}
4. Go to sys_properties.list -> create new property
glide.entry.first.page.script
type: string
value: new SPEntryPage().getFirstPageURL();
5. login with your test user and check.
Hope this will be helpful for you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2022 10:10 PM
Admin should not get redirected. so the condition should be updated
if (user.hasRole('xyz_role') && user.hasRole('snc_internal') && !user.hasrole('admin')) {
return '/your_portal';
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2022 04:33 PM
HI, have you reviewed this KB article
How to configure redirection for Service Portal - Support and Troubleshooting (servicenow.com)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2022 06:14 PM - edited 11-30-2022 06:16 PM
1. Navigate to Script include -> Search script with the name "SPEntryPage ".
2. Open the script in detail, Find the function "getFirstPageURL".
3. Add script as image below
if (user.hasRole('xyz_role') && user.hasRole('snc_internal')) {
return '/your_portal';
}
4. Go to sys_properties.list -> create new property
glide.entry.first.page.script
type: string
value: new SPEntryPage().getFirstPageURL();
5. login with your test user and check.
Hope this will be helpful for you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2022 10:10 PM
Admin should not get redirected. so the condition should be updated
if (user.hasRole('xyz_role') && user.hasRole('snc_internal') && !user.hasrole('admin')) {
return '/your_portal';
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2022 07:43 AM
Hello @Tuan Vu,
Yes, that's correct. That's how I implemented it. Thank you very much.
Best regards,
Ruaa