Direct Reports view

nyrguy451
Tera Contributor

Hello All,

 

I have a task that I can seem to figure out.

 

We have a New Hire form that managers use to onboard new employees.  The HR team wants to have the form do two things.

  1. The requestor (usually the manager) should be able to select the new hires from the "New Hire Name" drop-down variable which will only show the users that they manage (direct reports).
  2. Once the New hire is selected from the list it should auto-populate the rest of the fields (i.e. Department Name, Start Date, Company, Location, Job Title, Manager & Manager Email).

To add some background, we are importing the new hires from an SQL database to our sys_user table with all of the relevant fields listed above (2) and a unique identifier of "new hire" that is mapped to the source field in SNOW. The variable on the form "New Hire Name" is currently a text box but would like to change it to a reference field (sys_user) and only reference the users that the "requestor" manages (direct reports).  

 

If anyone could give me a pointer or hint as to how to go about doing this it would help me tremendously.

 

Best,

Marc

2 REPLIES 2

AnubhavRitolia
Mega Sage
Mega Sage

Hi @nyrguy451 

 

Please find few hints to achieve this:

 

1. New Hire form should be a Catalog Item or Record Producer.

2. 'New Hire Name' should be a reference table variable which should refer to User table.

3.Use advance Reference qualifier on "New Hire Name" variable to show only users whose Manager is Logged in user.

'manager='+gs.getUserID();

4. To Auto-populate other fields, use onChange Client Script on "New Hire Name" field. Get the Field Value details from User table using Script Include and GlideAjax and populate them on respective fields using setValue() function.

 

 

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023

Marcelo Pedrey1
Tera Contributor

Thank you Anubbhav but that did not resolve the issue.