Department is a string variable and need to autopopulate department name as per user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2025 10:40 AM
Kindly help and let me know how can i auto populate department name (department variable- string) for login user in service catalog. it auto populates sys id instead of department name. I need the variable single line text so that in case if some user donot have department name can manually entered. Please help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2025 07:29 AM
Hi @Momi
1st thing, make the department a reference that will be better, please check in the dictionary of the department display value is true or not.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2025 08:05 AM
Hello @Momi
- Seems like you are fetching the value using getValue() or getUniqueValue() method.
- Try using getDiSplayValue() method.
- It will be better if you can share the script so that I can help you modify the script.
If this helped, please like and mark it as an accepted solution. This helps future readers to locate the solution easily in community.
Thank You
Juhi Poddar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2025 09:09 AM - edited ‎01-27-2025 09:13 AM
Hi @Momi,
I have used a String field named 'Department' in the catalog item form.
Script Include: Make sure that the Script Include is set to Client Callable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2025 09:32 AM
If you have a variable with reference to the User table that's default value is the current user, you can easily use the Auto-populate on the Department variable and specify the dot-walk to a value you want. But the Dependent question needs to be a reference in order for this approach to work. I have Requested for variable which is a reference to the user table and it's default value is the current signed in user. Below is the setting of the Department variable