
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 03-09-2022 12:28 PM
RecordFieldGetter- An OOB ServiceNow Script include which can be used to get a value of any field from any table from the Client Side as shown below.
Input Arugments-
- sysparm_name- Always getValue
- sysparm_table-- Any table name
- sysparm_sys_id- Sys_id of a record
- sysparm_field_name- Required field name
This can be called from client-side or Server-side as well.
**********************************
var si=new GlideAjax('RecordFieldGetter');
si.addParam('sysparm_name','getValue');
si.addParam('sysparm_table','sys_user');
si.addParam('sysparm_sys_id',g_user.userID);
si.addParam('sysparm_field_name','user_name');
si.getXMLAnswer(function(userNameValue){
alert(userNameValue);
});
Regards,
Nayan
- 1,318 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
This is really helpful, Thanks!!

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Wow, it doesn't use GlideRecordSecure.
Unless I am mistaken, this would mean that any authenticated user can get any data they want if they have a minimum of read access to the record, provided they know the table, sys_id and field name, which isn't hard to get, by pasting this code into the console.

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Agree!, Paul. However, you can see they have a used canRead() check. So that should be fine. Thanks.