Popup Message after logging in to instance

ah16
Mega Expert

Hi,

Can you please provide steps to create popup window with a message after logging in to instance?

Similar like this one:  https://www.servicenowguru.com/system-definition/login-terms-conditions-dialog/

 

Thanks,

Ashraf

 

1 ACCEPTED SOLUTION

I have added a check so it will not run on login page. And changed to session variable so it will trigger each new login:

addLoadEvent(function () {
    var session = gs.getSession();
    if (session.getClientData('popup_triggered')) {
        return;
    }
    if ((window.name !== 'gsft_main') || (window.parent.document.URL.indexOf("login.do") > -1)) {
        console.log("Prevent popup in this window or on this page.");
        return;
    }

    session.putClientData('popup_triggered', 'true');


    //Ensure that we call the dialog for the correct frame
    if (window.frameElement) {
        if (window.frameElement.id == 'gsft_main') {
            showTerms();
        }
    }
    else if (!window.frameElement) {
        if (!$('gsft_main')) {
            showTerms();
        }
    }
});

View solution in original post

21 REPLIES 21

Hi willem,

I have some similar requirement, need your help in this.

When user logins into instance, let it be end user or user with ITIL role. and if language in their user profile is empty.

A UI page should pop up and ask them to provide language in a text box or string box, and the value given should be saved in their profiel.

Ui page should not pop up if users profile has language already.

Please help me with this.

Hi Rambo,

Is this still a requirement? If so, could you please log a new question for this. Feel free to tag me in it and I will try and help you with this.

I am curious about the language on the profile, does it not have a default value? For instance we most of the time set that to English and users can change it to any other language if they prefer.

If you could provide screenshot of the profile and maybe a mockup of what you like the popup to look like in your question, we can see if we could make something like that.

Hi Williem, 

 

Can you please tell is this script only sufficient to create a popup message when user login into instance?

Or any other script required please write complete steps.

Hi Kevin,

It is not a single script. I have written an article. Hope that helps:

https://community.servicenow.com/community?id=community_article&sys_id=ca3f3c47db7edc504aa5d9d968961...

Willem
Giga Sage
Giga Sage

Hi Ashraf,

You can also use Welcome Page. This is available to show to the users on login:

The welcome page contains instructions and any important information you would like to convey to your customers each time they log in to use the system.

https://docs.servicenow.com/bundle/orlando-platform-user-interface/page/administer/navigation-and-ui...