- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2024 01:21 AM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2024 01:50 AM
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
- 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
- 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
-
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
-
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();
-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2024 01:50 AM
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
- 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
- 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
-
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
-
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();
-