how to set Value for variables in RITM those are submitted?

Prathamesh Chav
Tera Contributor

Hi Team,

 

how to set Value for variables in RITM those are submitted?

I want to set value for company name ServiceNow variable field

PrathameshChav_0-1740122698127.png

 

Thanks

 

3 REPLIES 3

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Prathamesh Chav 

  1. If the request is already closed, no changes should be made. Once it's done, it's done. Don't add this value either through a script or any other method, as that could trigger an unnecessary audit process.

  2. If the request is still open and you're confident the same value applies to all requests, you can handle this easily from the list view. Add the variable to the list view, use "Update All" or select the rows, click the dropdown arrow, and update the value directly—no script needed.

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

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

Sourabh Tarlekr
Kilo Sage

Hi @Prathamesh Chav 

 

Your requirement is not clear but I am assuming that once RITM is submitted and company in servicenow company field is empty then update the RITM variable company.

 

You can do this by adding it your business rule for RITM table as below:

 

This is just an example you can add the business logic as per your requirement.

 

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

	if(current.variables.company_name=="")
	{
		current.variables.company_name=current.caller_id.company.name;
	}

})(current, previous);

 

Regards,

Sourabh

Ankur Bawiskar
Tera Patron
Tera Patron

@Prathamesh Chav 

you can use background script and set it

how is it getting fetched?

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