Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# inserting a new record into the sys_user table.
With this code, we are creating a new GlideRecord object for the 'sys_user' table, initializing it, setting the values for the 'user_name,' 'first_name,' 'last_name,' and 'email' fields, and then inserting a new record into the 'sys_user' table with the specified values.
In sys_user table a new rcord will be created
# Create User in ServiceNow (sys_user Table)
This script is used to create a new record in the sys_user table in ServiceNow.
It initializes a GlideRecord object, sets the required user details (username, first name, last name, and email), and inserts the record in sys_user table.
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
var gr=new GlideRecord('sys_user');
var user_name ="dhruvbhatheja";
var first_name = "Dhruv";
var last_name ='Bhatheja';
var email ='d@gmail.com';
gr.initialize();
gr.user_name='test.user';
gr.first_name='test';
gr.last_name='user';
gr.email='test.user@servicenow';
gr.user_name = user_name;
gr.first_name = first_name;
gr.last_name = last_name;
gr.email = email;
gr.insert();
Loading