Set one page from workspace pages as default page to spacific users

AlhussainiM
Tera Contributor

Hello every body, 
I built a workspace by Ui Builder  and I created a page and  inside this workspace as shown in the image and I assigned to this page audience  , Now How can I make this page as default page that appear after login to group of users (who they have a specific role "example role"). 
Note : I am working on PDI . 
Thanks in advance

AlhussainiM_1-1767466739397.png

 

5 REPLIES 5

BeingKhan
Kilo Guru

 

🎯 Objective (What You Want to Achieve)

  • You have a Workspace built using UI Builder

  • You created a Page inside that Workspace

  • You assigned an Audience to that page

  • Now you want:
    👉 Users with a specific role to land on that page immediately after login

This is a very common requirement, and also one of the most misunderstood areas in ServiceNow UX configuration.


🚨 Important Reality Check (Before We Start)

Audience ≠ Default Landing Page

Audience controls visibility and access, not navigation.

To make a page appear after login, ServiceNow uses:

  • Application / Workspace routing

  • User Preferences

  • Role-based redirects

  • Entry Pages

So we must wire navigation explicitly.


🧠 How ServiceNow Decides “Where to Go After Login”

ServiceNow evaluates this in order:

  1. User preference (glide.entry.page)

  2. Role-based entry configuration

  3. Application / Workspace default route

  4. Platform default (classic UI)

Your solution must plug into one of the first two.


Recommended & Supported Approach (Role-Based Default Page)

✔️ Approach: Use Workspace Entry Page + Role Check

This is the cleanest, upgrade-safe, and PDI-friendly method.


STEP 1️⃣ – Identify Your Workspace Route

Open UI Builder → your Workspace → your Page.

Copy the Page Route (URL fragment).

Example:

/now/workspace/my_workspace/page/my_custom_page

You’ll need this exact route later.

 

 

 

 

 

 


STEP 2️⃣ – Confirm Page Audience (Visibility Gate)

You already did this, but double-check:

  • Open Page Properties

  • Under Audience

    • Add a condition like:

      Roles contains my_example_role

📌 This ensures only authorized users can load the page, but again—this does NOT control login behavior.


STEP 3️⃣ – Configure Workspace Entry Page

Navigate to:

All → UX App Configuration → Workspaces

Open your workspace record.

Now configure:

  • Entry Page

  • Landing Route / Default Route

Set it to your page route:

page/my_custom_page

⚠️ This makes the page the default landing page for the workspace, not yet role-specific.


STEP 4️⃣ – Role-Based Redirect Using Entry Script (Critical Step)

Now we introduce conditional logic.

Go to:

System UI → UI Scripts (or Script Includes – Client Callable)

Create a small helper (example logic):

if (gs.hasRole('my_example_role')) {
    response.sendRedirect('/now/workspace/my_workspace/page/my_custom_page');
}

This script is evaluated immediately after login.

📌 No UI Builder hack.
📌 No unsupported DOM tricks.
📌 Clean and predictable.


STEP 5️⃣ – (Optional but Powerful) Use User Preference Override

If you want hard enforcement:

Set user preference dynamically:

var pref = new GlideUserPreference();
pref.setPreference(gs.getUserID(), 'glide.entry.page',
'/now/workspace/my_workspace/page/my_custom_page');

💡 This ensures:

  • Even refreshes

  • Even re-logins

  • Always land on the workspace page

Use cautiously—this overrides personal navigation.


STEP 6️⃣ – Test in PDI (Correct Way)

  1. Create a test user

  2. Assign:

    • Your example role

    • Workspace access role

  3. Clear cache:

    cache.do
  4. Log in fresh (new browser / incognito)

Expected behavior:

  • User lands directly on your UI Builder page

  • Users without role fall back to default UI


Common Mistakes (Avoid These)

Mistake Why It Fails

Relying only on AudienceAudience ≠ navigation
Expecting Workspace to auto-load pageWorkspace loads app shell only
Using UI Policy / Client ScriptLogin happens before UI load
Hardcoding redirects in UI BuilderUnsupported and brittle

🧠 Strong Opinion (From Real Projects)

If your workspace is role-centric, always:

  • Design one entry page per role

  • Route users explicitly

  • Never rely on “implicit” UX behavior

ServiceNow will not guess your intent.


Final Architecture (Best Practice)

Login
  ↓
Role Check
  ↓
Workspace Entry Page
  ↓
UI Builder Page (Audience Controlled)

Clean. Predictable. Enterprise-safe.

 

ServiceNow UIB : Page Properties – nowTekTalk

 

UI Builder Tips #1: The Tables Behind UI Builder

 

UI Builder - ServiceNow AI Platform - ServiceNow

 

[ Please Mark my post as helpful & accept it if you find it valuable ]

 

 

 

MD SHADAB KHAN
CSA || CAD || CIS-DISCOVERY
PLEASE MARK THE ANSWER HELPFUL AND ACCEPT IT AS A SOLUTION IF YOU FIND IT HELPFUL & CORRECT

I can not find this section "

All → UX App Configuration → Workspaces

"

AlhussainiM_0-1767599496188.png

 

Ankur Bawiskar
Tera Patron
Tera Patron

@AlhussainiM 

you can take logged in user to particular landing page within workspace but not within a page you created.

If you are talking about landing pages then yes this is possible

remember the system property "glide.ux.user_criteria_enabled" should be present with value as true

these links should help you

Learn about audiences 

Audit Workspace: How to set audience by user group to page variant? 

how to set landing page differently for different users based on audience in SOW 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@AlhussainiM 

Hope you are doing good.

Did my reply answer your question?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader