Training page for new user

jean-lucchatton
Giga Guru

Hello,

 

I would like to display a training page for new users.  The idea is that this page / video, should be automatically been displayed on the first login of each new user.

 

Do you know how to do this?

 

Thank you

Jean-Luc

1 ACCEPTED SOLUTION

Ravi Gaurav
Giga Sage

Hello @jean-lucchatton 

 

To display a training page or video automatically on the first login of each new user in ServiceNow, you can follow these steps:

 

Step 1: Create the Training Page or Video

  1. Create a Catalog Item or Knowledge Article:
    • If you want to display a video or training material, you can create a Knowledge Article or a Service Catalog Item that contains the content you want to show to new users.

Step 2: Identify New Users

  1. Determine New User Status:
    • You can identify new users based on a specific attribute, such as the sys_created_on date or by adding a custom field (e.g., first_login).
    • For example, you could create a boolean field on the User table (sys_user) called first_login that defaults to true when a user is created.

Step 3: Create a Business Rule

  1. Create a Business Rule:

    • Navigate to System Definition > Business Rules.
    • Create a new Business Rule that runs on the sys_user table.
    • Set the conditions to check if the user is new (e.g., first_login is true).
    • In the Business Rule's script, set the first_login field to false after the first login.


      (function executeRule(current, previous /*null when async*/) {
      // Check if this is the first login
      if (current.first_login) {
      // Set the first_login field to false
      current.first_login = false;
      current.update();

      // Optionally, you can log the event or trigger a notification
      }
      })(current, previous);


      Step 4: Display the Training Page or Video

      1. Create a UI Script or UI Page:

        • Create a UI Script or UI Page that checks if the user is new (using the same condition as above).
        • If the user is new, display the training page or video in a modal dialog or redirect them to the page.

          function showTrainingPage() {
          var user = new GlideRecord('sys_user');
          user.get(gs.getUser ID());

          if (user.first_login) {
          // Display the training content
          alert("Welcome! Please check out our training materials.");
          // Optionally redirect to a specific page
          // window.location.href = 'your_training_page_url';
          }
          }

          // Call the function on page load
          showTrainingPage();

View solution in original post

1 REPLY 1

Ravi Gaurav
Giga Sage

Hello @jean-lucchatton 

 

To display a training page or video automatically on the first login of each new user in ServiceNow, you can follow these steps:

 

Step 1: Create the Training Page or Video

  1. Create a Catalog Item or Knowledge Article:
    • If you want to display a video or training material, you can create a Knowledge Article or a Service Catalog Item that contains the content you want to show to new users.

Step 2: Identify New Users

  1. Determine New User Status:
    • You can identify new users based on a specific attribute, such as the sys_created_on date or by adding a custom field (e.g., first_login).
    • For example, you could create a boolean field on the User table (sys_user) called first_login that defaults to true when a user is created.

Step 3: Create a Business Rule

  1. Create a Business Rule:

    • Navigate to System Definition > Business Rules.
    • Create a new Business Rule that runs on the sys_user table.
    • Set the conditions to check if the user is new (e.g., first_login is true).
    • In the Business Rule's script, set the first_login field to false after the first login.


      (function executeRule(current, previous /*null when async*/) {
      // Check if this is the first login
      if (current.first_login) {
      // Set the first_login field to false
      current.first_login = false;
      current.update();

      // Optionally, you can log the event or trigger a notification
      }
      })(current, previous);


      Step 4: Display the Training Page or Video

      1. Create a UI Script or UI Page:

        • Create a UI Script or UI Page that checks if the user is new (using the same condition as above).
        • If the user is new, display the training page or video in a modal dialog or redirect them to the page.

          function showTrainingPage() {
          var user = new GlideRecord('sys_user');
          user.get(gs.getUser ID());

          if (user.first_login) {
          // Display the training content
          alert("Welcome! Please check out our training materials.");
          // Optionally redirect to a specific page
          // window.location.href = 'your_training_page_url';
          }
          }

          // Call the function on page load
          showTrainingPage();