From a892248afc33edae341659d57093617d19cd1fa7 Mon Sep 17 00:00:00 2001 From: DhruvBhatheja <70469942+DhruvBhatheja@users.noreply.github.com> Date: Wed, 1 Oct 2025 18:50:52 +0530 Subject: [PATCH 1/2] Update script.js --- .../script.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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(); From 89505906dee746b84b5b1b593ad12c8d7a9d8009 Mon Sep 17 00:00:00 2001 From: DhruvBhatheja <70469942+DhruvBhatheja@users.noreply.github.com> Date: Wed, 1 Oct 2025 18:54:48 +0530 Subject: [PATCH 2/2] Update README.md --- .../README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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.