Comments on: User Object Cheat Sheet https://servicenowguru.com/scripting/user-object-cheat-sheet/ ServiceNow Consulting Scripting Administration Development Tue, 12 Mar 2024 21:11:22 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: JV https://servicenowguru.com/scripting/user-object-cheat-sheet/#comment-10029 Tue, 14 Mar 2023 00:30:46 +0000 https://servicenowguru.wpengine.com/?p=1079#comment-10029 Article still relevant after 13 years. Amazing !

]]>
By: theresa https://servicenowguru.com/scripting/user-object-cheat-sheet/#comment-10028 Wed, 14 Sep 2022 21:54:05 +0000 https://servicenowguru.wpengine.com/?p=1079#comment-10028 Thank you for the awesome tips! Your whole website is fantastic. :-)

]]>
By: abrouf https://servicenowguru.com/scripting/user-object-cheat-sheet/#comment-10025 Tue, 27 Jul 2021 17:53:45 +0000 https://servicenowguru.wpengine.com/?p=1079#comment-10025 Extremely helpful, thank you, Mark!

]]>
By: Joel https://servicenowguru.com/scripting/user-object-cheat-sheet/#comment-10021 Wed, 27 Dec 2017 22:03:11 +0000 https://servicenowguru.wpengine.com/?p=1079#comment-10021 These articles are so helpful, thank you Mark for making this public information.

]]>
By: Mark Stanger https://servicenowguru.com/scripting/user-object-cheat-sheet/#comment-10020 Wed, 08 Mar 2017 20:33:18 +0000 https://servicenowguru.wpengine.com/?p=1079#comment-10020 In reply to Vivek.

Sure. Take a look at the ‘title’ example at the bottom of the article. It shows how you can use a GlideRecord query to get any additional information about the user (including company) that you want.

]]>
By: Vivek https://servicenowguru.com/scripting/user-object-cheat-sheet/#comment-10019 Wed, 08 Mar 2017 12:13:50 +0000 https://servicenowguru.wpengine.com/?p=1079#comment-10019 Hi Mark,

I wanted to know if we could access the company of the user involved, using the g_user field.

Thanks and Regards,
Vivek

]]>
By: Shane C https://servicenowguru.com/scripting/user-object-cheat-sheet/#comment-10018 Wed, 29 Jan 2014 19:48:14 +0000 https://servicenowguru.wpengine.com/?p=1079#comment-10018 In reply to Mark Stanger.

Sorry to keep filling this up, but I can’t figure out how to edit my previous post.

On further testing, javascript:gs.getUser().getRecord().getValue(‘phone’) does work in a Set Value step of the workflow, however it pulls the phone number of the user logging in the incident, not the phone number of who the “client” has been set to for the incident. Any way to modify this?

Much thanks Mark

]]>
By: Shane C https://servicenowguru.com/scripting/user-object-cheat-sheet/#comment-10017 Wed, 29 Jan 2014 19:44:25 +0000 https://servicenowguru.wpengine.com/?p=1079#comment-10017 In reply to Mark Stanger.

An update, I made a script step in the workflow, and the following works in my system:

var businessphone = gs.getUser().getRecord().getValue(‘phone’);
current.u_cos_contact_no = businessphone;

Now to try it as a Set Value step in the workflow, with javascript:gs.getUser().getRecord().getValue(‘phone’);
Not sure if it will work, but it’s work a shot to eliminate extra steps in the workflow.

]]>
By: Shane C https://servicenowguru.com/scripting/user-object-cheat-sheet/#comment-10016 Wed, 29 Jan 2014 19:38:22 +0000 https://servicenowguru.wpengine.com/?p=1079#comment-10016 In reply to Mark Stanger.

On my incident form, “Contact Phone” variable is called u_cos_contact_no.

In my client’s user form, “Business Phone” variable is called phone.

For my workflow, would I want to do a custom script, or simply put do a Set Values, and then use javascript:gs.getUser().getRecord().getValue(‘phone’) ?

]]>
By: Mark Stanger https://servicenowguru.com/scripting/user-object-cheat-sheet/#comment-10015 Wed, 29 Jan 2014 19:34:01 +0000 https://servicenowguru.wpengine.com/?p=1079#comment-10015 In reply to Shane C.

Correct. As long as ‘phone’ is the name of the field you want to pull the value from.

]]>