Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Transform Map

Vaibhav Sharma1
Tera Contributor

Hi All,

I am trying to understand "how to restrict transform map from creating any new record, only update, even if values of coalesce fields not matching".

Any inputs are valuable

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@Vaibhav Sharma1 

you should use onBefore transform script and stop

(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {

	// Add your code here
	if(action == 'insert'){
		ignore = true;
	}

})(source, map, log, target);

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

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Vaibhav Sharma1 

 

This is the purpose of colsec. if match update else create new record. What is use case you have to not to create new record.

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

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