The CreatorCon Call for Content is officially open! Get started here.

how to route users to employee center based on specific user criteria

sath
Tera Expert

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?

3 REPLIES 3

Nehal Dhuri
Mega Sage

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...

Please hit like and mark my response as correct if that helps

M Iftikhar
Giga Sage

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.

Medi C
Giga Sage
Giga Sage

Hi @sath,

Could you please:

  1. Go to the Script Include "SPEntryPage"
  2. Adjust the function "getFirstPageURL" As per your requirements
  3. 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.