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 to add Catalog item variable to watch list?

Rajyalakshmi
Mega Guru

Hi Team,

 

 i need to add catalog item variable which contains user email to the watch list ,could you please suggest how i can achieve this ?

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Rajyalakshmi 

so you want to update watch_list of RITM with the value from catalog item variable?

if yes then you can do this in multiple ways

1) flow designer

-> if you are using flow for your catalog item, then you can set the watch list using "Update Record" flow action using value from "Get Catalog Variables" flow action

OR

2) workflow

-> if you are using workflow then you can use run script in your workflow, something like this

current.watch_list = current.variables.variableName;

OR

3) after insert business rule on RITM table

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

	// Add your code here
current.watch_list = current.variables.variableName;
current.setWorkflow(false);
current.update();

})(current, previous);

💡 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

View solution in original post

2 REPLIES 2

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Rajyalakshmi 

 

https://www.servicenow.com/community/itsm-forum/populate-the-watch-list-field-from-a-variable-that-i...

 

https://www.servicenow.com/community/developer-forum/want-to-add-watch-list-in-catalog-item/m-p/2641...

 

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

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

Ankur Bawiskar
Tera Patron
Tera Patron

@Rajyalakshmi 

so you want to update watch_list of RITM with the value from catalog item variable?

if yes then you can do this in multiple ways

1) flow designer

-> if you are using flow for your catalog item, then you can set the watch list using "Update Record" flow action using value from "Get Catalog Variables" flow action

OR

2) workflow

-> if you are using workflow then you can use run script in your workflow, something like this

current.watch_list = current.variables.variableName;

OR

3) after insert business rule on RITM table

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

	// Add your code here
current.watch_list = current.variables.variableName;
current.setWorkflow(false);
current.update();

})(current, previous);

💡 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