diff --git a/Server-Side Components/Background Scripts/inserting a new record into the sys_user table/README.md b/Server-Side Components/Background Scripts/inserting a new record into the sys_user table/README.md index 2d91314167..74cffc2b70 100644 --- a/Server-Side Components/Background Scripts/inserting a new record into the sys_user table/README.md +++ b/Server-Side Components/Background Scripts/inserting a new record into the sys_user table/README.md @@ -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. diff --git a/Server-Side Components/Background Scripts/inserting a new record into the sys_user table/script.js b/Server-Side Components/Background Scripts/inserting a new record into the sys_user table/script.js index 1d6d720d99..415c4c074a 100644 --- a/Server-Side Components/Background Scripts/inserting a new record into the sys_user table/script.js +++ b/Server-Side Components/Background Scripts/inserting a new record into the sys_user table/script.js @@ -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();