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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your submission. It appears that this pull request contains more files than described in the title. Please review and update the pull request to either remove the extra/unintended files or to update the description to be more comprehensive. Ensure your contributions are meaningful and adhere to the project’s standards. You can create a new branch on your forked repository to avoid accidental inclusions of new commits in the future. Closing this for now. Once you make additional changes, feel free to re-open this Pull Request or create a new one.

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.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Base64 Encode Before Save / Decode on Display

Explanation:

Goal: Store sensitive or formatted data (like text) in an encoded format in the database while still allowing users to see and interact with the readable version.

Before Insert/Update → Encode (secure storage).

Before Display → Decode (user-friendly display).

It’s a example of data transformation for secure storage and transparent display.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//This is Before Insert/Update Business Rule to automatically store sensitive data in Base64 form.

(function executeRule(current, previous) {
if (current.variblename.changes()) {
var plainText = current.variblename + '';
current.variblename = GlideStringUtil.base64Encode(plainText);
}
})(current, previous);





//this is Display busiess rule to make sure users see the decoded text instead of Base64

(function executeRule(current) {
if (current.variblename) {
try {
var decoded = GlideStringUtil.base64Decode(current.variblename);
current.setDisplayValue('variblename', decoded);
} catch (ex) {
current.setDisplayValue('variblename', '[Invalid Base64]');
}
}
})(current);
Loading