In a business rule, which function returns the sys_id of the currently logged-in user?

Prepare effectively for the ServiceNow CAD certification. Study with detailed questions and explanations. Enhance your skills and knowledge for success in your exam!

Multiple Choice

In a business rule, which function returns the sys_id of the currently logged-in user?

Explanation:
GlideSystem (gs) in server-side code is used to fetch information about the current session. To obtain the unique identifier of the logged-in user, you use the function that returns that user’s sys_id, which is gs.getUserID(). The sys_id identifies the user in the sys_user table, making it reliable for comparisons and data linking in a business rule. If you need the actual login name instead, you’d use gs.getUserName(), but that gives a username rather than the sys_id. The other function names aren’t part of the GlideSystem API or would return a different value (such as a username), so they don’t provide the needed sys_id.

GlideSystem (gs) in server-side code is used to fetch information about the current session. To obtain the unique identifier of the logged-in user, you use the function that returns that user’s sys_id, which is gs.getUserID(). The sys_id identifies the user in the sys_user table, making it reliable for comparisons and data linking in a business rule. If you need the actual login name instead, you’d use gs.getUserName(), but that gives a username rather than the sys_id. The other function names aren’t part of the GlideSystem API or would return a different value (such as a username), so they don’t provide the needed sys_id.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy