- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-04-2023 07:43 AM
Hello everyone,
I am currently trying to auto-populate a field on my Cat Item.
It should have the Head of Department of the Users department (cmn_department)
What type of variable should I use and what if I in the future the customers want to have multiple "Head of Department" - User? How can I make this work with one and what would change if the future case happens?
I have attached my current response but couldn't decide how to actually auto-populate it.
Thanks to everyone in advance š
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-07-2023 01:54 AM
Ok so I found the solution to it.
By adding the following lines to the "Default Value" it auto-fills it with the right dept_head:
javascript:var userDept=gs.getUser().getDepartmentID();
var deptHead='';
var deptGR=new GlideRecord('cmn_department');
if(deptGR.get(userDept)){deptHead=deptGR.getValue('dept_head');}
deptHead;
Thanks again everyone nonetheless š
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-06-2023 09:25 PM
Hello @Konstantinos Di
Greetings!
Any feedback on my reply? were you able to do this.?
Please mark the answer as correct solution and helpful if helped.
Kind Regards,
Ravi Chandra