Auto-populate User in Record Producer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2025 10:14 PM
Hi,
I have created one record producer. In the record producer, there is a field called Impacted User. It will be auto-populated based on the current logged-in user. If want, after populating impacted user can be edited. After populating the Impacted User, the next field Location will be auto-populated based on the Impacted User field. To auto-populate the Impacted User field, I used the following code :
javascript:gs.getUserID();
in the Default value of the Impacted User variable in the record producer. It is working fine. But for some demo users I created, initially the Impacted User field gets populated and the location will be auto-populating based on this. But if I edit the Impacted User field, the location is not getting populated. The location field list is showing users list in that case.I created some demo users. So if I log in as one demo user and edit the impacted user to another demo user that I created this situation happens. In all other situations, it is working fine. Why this happens? The initial image attached is working when the demo user initially login. But when the impacted user is changed, the loxation field is not getting auto-populated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2025 09:40 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2025 01:53 AM
Here, in my case, end user (no role) cannot create request for others. In that case, the location field is not auto-populating.But when I assigned itil role to that end users, it is working. Why is it so? In the image, if it is service desk agent and I change the impacted user, the location field will auto-populate. It is fine. But if the currently logged-in user is an end user, so initially the Impacted User field will auto-populate as the end user. But if I change the impacted user then the location is not auto-populating. It is left blank.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2025 02:30 AM
that's because end user is not having read access to location table.
Use GlideAjax with GlideRecord and it should work as ACLs are not evaluated while using GlideRecord
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2025 02:33 AM
Can you please help on how to do this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2025 01:34 AM
In my case, no end user(no role) can create any request for others. That is the case.