Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How can we add the Add me icon next to the watchlist field in incident table in csm workspace level

mastanbe
Tera Contributor

Hi All,

 

I have a requirement to add the icon Add me icon next to the watchlist field in csm workspace level. when user click it, current user will add to that watch list. how we can do that in workspace level.

 

Kinldy please help me on this one. 

mastanbe_0-1761921549705.png

 

3 REPLIES 3

Shruti
Mega Sage
Mega Sage

Hi,

Navigate to Field Decorators. Create a new field decorator

Shruti_0-1762322406455.png

Shruti_2-1762322978654.pngShruti_3-1762322993618.png

 

Paste below client script 

function onClick() { 
	var existingWatchlisUsers = g_form.getValue('watch_list');
	if(existingWatchlisUsers){
		existingWatchlisUsers += ',' + g_user.userID;
	}
	else{
		existingWatchlisUsers = g_user.userID;
	}
	g_form.setValue('watch_list',existingWatchlisUsers);
	
}

 

Ankur Bawiskar
Tera Patron
Tera Patron

@mastanbe 

you can refer any OOTB Field Decorator and create similar for your table

I found this for GRC Table, replicate this for your table

UI Builder Deep Dives: Field Action Decorator 

AnkurBawiskar_0-1762328096961.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

@mastanbe 

Hope you are doing good.

Did my reply answer your question?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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