The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Autopopulate the variable in the catalog item with the logged in usermail, username and manager

saikirangd9
Mega Contributor

I have been assigned to the task to create the catalog item and variables. I have created the variables and catalog item. Now there is a requirement to autopopulate the variable values as follows and give me the best practice or approach to do this requirement:

 

Create a new Catalog Item named "Request New Hardware Device".

1. Requested By – auto populated with logged in user’s name. 1

2. Requestor’s Email – Auto Populated with logged in user's email address. 1

3. Manager Name - Auto Populated with the manager’s name of logged in user.

1 REPLY 1

mayankkumar
Tera Sage

Hi @saikirangd9,
There are multiple ways to achieve this

1. Using Catalog OnLoad Client script
In this you need to make a call to you script include using GlideAjax and from that script include you can get the desired values and set them to your variables

2. Using Default value & Auto Populate functionality on the variable record
For Requested by you can set the default value like this ->

mayankkumar_0-1758132316792.png

and then for rest email and manager name you can use Auto Populate tab and select Requested by as the dependent question

NOTE-: You need to keep in this mind if your end user going to use this catalog and you need manager information like his name etc then autopopulate may not work from Autopopulate tab you need to stick with script include and catalog client script approach then

If you need further help do let me know
--------------------------------------------------------------------------------------------------------------------------------------------
Please mark my response helpful and accept as solution
Thanks & Regards
Mayank