Record Producer question default value to get current user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2023 12:57 PM - edited 08-18-2023 12:58 PM
In a record producer I want to have a Question:
Requester:
(have the current user default, but changeable to any user in the user table)
I set Question type Choice and Question subtype Dropdown (values from a table) and I mention the User table on the Additional details tab.
I am stuck on the default value - what syntax to put here? I can't just type in gs.getUserID() is there something else to use?
*************
Apologies I know this is a newbie question. Is there some place I can learn this type of syntax quickly? (i.e, without multiple hours of Now Learning. Sample AES apps to download and play with or a quick reference guide or some good short videos would be ideal.
*************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2023 01:53 PM - edited 08-18-2023 02:06 PM
Hi @VL10 the below URL's will really help you to understand with your question
https://thesnowball.co/how-to-set-a-default-field-value-in-servicenow/#
Cheers, hope that helps
Eswar Chappa
*** Please mark as "Correct" or "Helpful" as appropriate ***

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2023 03:18 PM
Hello @VL10,
Don't use variable type as choice for this
You can use this new ServiceNow feature.
Use Variable type - "Requested For"
This does exactly the same as you are looking for.
If your field is meant to capture the requestor or requested on behalf of, this variable type is the perfect solution for it. And it's completely OOTB, no Code solution.
Kind Regards,
Swarnadeep Nandy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2023 04:29 PM
How do I use that? You can't just paste it in the box like this in the Record Producer config?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2023 09:18 PM
Hi - still waiting for how to use this!