how to route users to employee center based on specific user criteria
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10 hours ago
Hi,
We need to route all users who report to a specific person to employee center portal when they try to access ServiceNow. Can anyone assist on how to achieve this requirement?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10 hours ago
Do you want to redirect user based on role?
Please refer to the following article this might be helpfull for you:
https://www.servicenow.com/community/developer-articles/role-based-redirection-with-spentrypage/ta-p...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10 hours ago
Hi @sath,
To achieve this, you should modify the SPEntryPage Script Include, which is the standard method for controlling portal redirection. In the getFirstPageURL function of this script, add a condition to check if the currently logged-in user's manager is the specific person you've identified. You can get the user's manager with gs.getUser().getManagerID(). If the manager's sys_id matches your target, set the redirect URL to the Employee Center portal suffix (e.g., /esc). This ensures that only the direct reports of that specific manager are automatically routed to the correct portal upon accessing ServiceNow.
Thanks & Regards,
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10 hours ago
Hi @sath,
Could you please:
- Go to the Script Include "SPEntryPage"
- Adjust the function "getFirstPageURL" As per your requirements
- Ensure the system property "glide.entry.first.page.script" is set to:
new SPEntryPage().getFirstPageURL();
If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.