How do auto populate requested field on Project form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2022 11:25 AM
I am a sys admin and not familiar with the whole development/config in ServiceNow
I do, however, want to auto-populate a Requested by field on the Project form so that whenever I open up the project form it auto-populates with the logged-in user
I would like for it to auto-populate with the logged-in user just like the change request form
On the change form, when you open it to create a change request, it auto-populates the requested by the user.
I have tried looking at OOTB to see if I can see the configuration but I am not able to identify it
Thank you
I am sure if I am able to identify the code, I should be able to get it done.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2022 11:35 AM
Hello ,
You an follow these steps
1) Open the project form
2) right click on the requested for field name like below
3) click on configure dictionary as show in above picture
4) Once clicking on it scroll down to the bottom and you can see Default value section .Click on that
5)Please write the below script in the field DEFAULT VALUE like below
javascript:gs.getuserID();
6)Try to create a new project record and check if it is auto populating
Please accept my answer if it helped you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2022 12:55 PM
I updated the script field to javascript:gs.getuserID();
Did not work to auto-populate the form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2022 01:02 PM
Sorry my bad it was a typo
It should be U uppercase can you please try the below one
javascript:gs.getUserID()
Please mark my answer correct if it helps you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2022 01:33 PM
ok, this time around it works but I don't see the changes captured in my update set. How can I get it on my update set please, I also have a previous script on the default value as javascript.global.incidentGetCaller();
Will changing the default value to javascript.gs.getUserID(); affect any functionality