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  

Script for ignore duplicate records while insert using Transform maps

Rajesh Sheela1
Tera Contributor

I want Script for ignore duplicate records while insert using Transform maps. Can anyone help me on this?

2 REPLIES 2

Gunjan Kiratkar
Kilo Patron
Kilo Patron

Hi @Rajesh Sheela1 ,

If you want to ignore duplicate then you can use script option and ignore if data is found in that particular table using.Just example script:--

 

var gr =new GlideRecord('incident');
gr.addQuery('short_description',source.short_description);
gr.query();
if(gr.next()){
ignore=true;
}

 

If you want to update the record if duplicate found then make one field asCOALESCE.


Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy

@Gunjan Kiratkar  As per my requirement i have two fields Model 1 and Model 2. Against Model 1 if I will try to insert two model 2 's with same name one should ignore and one should insert. I need help in this. Please help me on this.