Different portals based on user's company

karthikgowda
Kilo Contributor

Hello Everyone,

Has anybody worked on Service Portal user redirect to Specific portals based on some conditions ?

I have a requirement where there a multiple portals for different companies and when user login to the Servicenow, User should

navigate into their company's portal.

For example : There are different portals for "X" and "Y" companies and If i belong to a "X" company ,i should be navigated into"X"Company's portal.

Your feedbacks are much appreciated.

Thanks & Regards,

Karthik

5 REPLIES 5

Community Alums
Not applicable

Karthik,



I've done this exactly. You'll need to use a UI Script with the following event name in it:



find_real_file.png



This will ensure that the script doesn't run until you have access to all the functions you need to use to run queries of the user table, or the Session Client Data.



Once you have this in your script, just run your queries and do your comparisons to figure out where the person should go. Once you determine where they're supposed to go, you'll use this code to redirect them:



find_real_file.png



where window.top.location.href = the url of the portal to which you want to direct the user.


Hi Karthik,

 

I have exactly the same requirement to design different portals based on the user's company and struggling to get this working. Really appreciate if you can to post the code in here?

 

 

karthikgowda
Kilo Contributor

Hi Andrew,



Thanks for your response. I tried doing the same but it doesn't seems to be working and navigates to dashboard homepage . It doesn't navigate to any of the portals after login. Do you mind sharing the sample code please ?




Regards,


Karthik


Community Alums
Not applicable

It might be more useful for you to post your code. That way I could tell you what was wrong with it, instead of you trying to guess how to adapt mine.