ServiceNow Certified Application Developer — Question 54

In a Business Rule, which one of the following returns the sys_id of the currently logged in user?

Answer options

Correct answer: C

Explanation

The correct answer is C, gs.getUserID(), as it specifically returns the sys_id of the logged-in user in the context of a Business Rule. Option A is incorrect because g_form.getUserID() is used in client scripts, not server-side code. Option B, gs.getUserSysID(), is a valid command but does not exist in the ServiceNow scripting context, while D, g_form.getUserSysID(), is also a client-side method and not applicable in this scenario.