Script for ignore duplicate records while insert using Transform maps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2022 10:48 PM
I want Script for ignore duplicate records while insert using Transform maps. Can anyone help me on this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2022 11:24 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2022 11:30 PM
@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.