How to add a CI (assigned To computer) to the user pop up view

Ian46
Tera Contributor

Hi,

 

When I am on an Incident form and press the information button next to the Caller field a pop up appears with the sys_user details. I would like to include information such as what computer has been assigned to this user.

 

Are we able to do this?

 

Thanks Ian

4 REPLIES 4

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Ian46 

 

This is called sys_pop up view. I am not sure you can do in same popup as computer is an asset and to get this you can add another symbol to see what asset tagged to user. 

https://INSTANCENAME.service-now.com/now/nav/ui/classic/params/target/sys_ui_view.do%3Fsys_id%3Dc740...

*************************************************************************************************************
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]

****************************************************************************************************************

Ian46
Tera Contributor

I am not sure how to add it from here, I think I had it working before somehow and perhaps used this record attached.

@Ian46 

caller_id field refers to sys_user table and there is no OOB computer field on sys_user table.

So you cannot show the computer assigned to that user on sys_popup view.

To achieve your requirement do this

1) have a Computer reference field on sys_user and add that on sys_popup view

2) then have an after update/insert BR on cmdb_ci_computer table and search that user and update the Computer field with the current record sysId

Something like this

BR: After insert/update

Condition: current.assigned_to != ''

Script:

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	var userRec = current.assigned_to.getRefRecord();
	userRec.u_computer = current.getUniqueValue(); // give here the name of newly created computer field on user table
	userRec.update();	

})(current, previous);

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Ian46
Tera Contributor

Thanks, I wondered if it could be added as like a related list instead?