How to populate reference variable value on form from default value in variable?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-03-2024 05:02 AM
I want "what is your department" to be populated when "who is requested for?" is selected.
"what is your department" is a reference field .
"who is requested for?" is a text field. In default value I have used "who is requested for?"
Can anyone please suggest what should I write in default value for "what is your department" variable, so that it should populate when the form loads
I tried by using, but none of them worked, I am getting the value as blank as attached in screenshot:
1.javascript:gs.getUser().getRecord().getDisplayValue('department'); ( department is backend name for "what is your department")
2. javascript:gs.getUser().getDepartmentID();
3.
javascript:var dept=gs.getUser().getDepartmentID();if(dept)dept;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-03-2024 09:39 PM
Hi Shubham,
You can use the auto-populate feature available OOB in ServiceNow.
Please refer below screen shots.
If my answer helped you in any way please mark it as correct.