Is it possible to set Homepage is different based on users/Groups/roles?

akin9
Tera Contributor

Hello All

Is it possible to keep Homepage is different based on users/Groups/roles

Requirements

We want to set login home page as one of our workspace page for particular groups of users.

Remaining as usual 

We have created a user preference but its working for all,

tried multiple methods but no luck.

Please support to achieve this it will be grateful

its an urgent requirement but no luck i want to know its possible or not?.

9 REPLIES 9

Ranjit Nimbalka
Mega Sage

Hi @akin9 ,

Please look into this below thread, it helped me to achieve a similar requirement:-

https://www.servicenow.com/community/developer-forum/set-homepage-based-on-role/m-p/1989601

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,
Ranjit

Hi @Ranjit Nimbalka 

We have tried the same but no luck.

Can you pls check if any other possibilities are there?

(function executeRule(current, previous /*null when async*/ ) {

    if (current.role.name == "BVP") {
        var home = new GlideRecord('sys_user_preference');
        home.addQuery('name', 'homepage');
        home.addQuery('user', current.user.toString());
        home.query();
        if (home.next()) {
            home.value = ('sys_id')
            home.update();
        } else {
            home.description = 'Added based on the role';
            home.name = 'homepage';
            home.type = 'string';
            home.value = 'sys_id';
            home.user = current.user.toString();
            home.insert();
        }
        // Add your code here
    }
})(current, previous);

Sujatha V M
Kilo Patron
Kilo Patron

@akin9  Hoping that this helps you. Can you try the below for routing with order in UI builder? 

 

In each Landing page, you have the option to add the audiences under "Settings" 

 

For eg. Below we have deactivate the routing to SOW workspace and have segregated based on admin and other users. 

 

SujathaVM_0-1713331013131.png

 

Please mark this as helpful and accept it as a solution if this resolves your query.

Thanks,

Sujatha V.M.

 

Please mark this as helpful and accept it as a solution if this resolves your query.
Sujatha V.M.

Hi @Ranjit Nimbalka @Sid_Takali @Sujatha V M 

Thanks for the quick reply!

I have added a audience and  tried the same but no luck.

 

Please check

akin9_0-1713335790920.png