We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Danish Bhairag2
Tera Sage

Problem Statement:

In multi-domain implementations on ServiceNow, users often work in the backend (Operations / Platform UI) but need to access different portals depending on their domain (HR, IT, Facilities, etc.).

Out of the box, there’s no simple way to have one backend module that redirects users to the correct portal automatically. Here’s a lightweight approach that solves this.

 

Requirement

  • Single backend module

  • Redirect users to the correct portal

  • Portal selection based on user domain


  •  Solution Overview
  1. Create a backend module with name of your wish (I created Switch to Portal View)

  2.  

    Screenshot 2026-02-28 145421.png

  3. In Arguments call a UI page. (Create UI page from All->System UI->UI pages)

  4. Screenshot 2026-02-28 150033.png
  5. Create a Server Side Script where domain logic will be written. Note i have used a system property to take care of the different portals & stored the values as a JSON key value pair.
  6. Screenshot 2026-02-28 150553.png
{
"Domain1": "/portal1", 
"Domain2": "/portal2",
"Domain3": "/portal3",
"Domain4":"/portal4"
}
  • System property helps in keeping the code clean & in future u want to include more domains u don't need to touch the code rather update the property & things will work.
 
Outcome

✔ Redirects cleanly to the portal
✔ Avoids backend header showing up
✔ Works across domains


 Important Notes

  • Avoid window.location or location.href

  • Always use top.location for backend → portal navigation

  • Keep domain logic server-side for security and scalability


 Benefits

  • One-click navigation for users

  • Domain-aware portal experience

  • Cleaner UX in multi-domain environments

  • Easy to extend for new domains

 

Thanks,

Danish Bhairagdar