ignore inactive records during update and insert new record instead, when using import set
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi,
I am importing data from excel sheet using import set and transform map. I have a coalesce field. while doing so, it should ignore the update for the inactive incidents and insert active new incidents when coalesce field matches for inactive incidents, for active incidents it should update.
Please let me know if anyone have a solution to achieve this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
coalesce is on which field? share screenshot
you can use onBefore transform script and check if operation is insert/update and target record is active or not
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
// Add your code here
if (action == 'update' && target.active.toString() == 'false')
ignore = true;
})(source, map, log, target);
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hope you are doing good.
Did my reply answer your question?
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Coalesce: Set your unique field to Coalesce = true in the field map.
OnBefore Transform Script: Use this script to intercept the update, check if the matched record is inactive, and ignore it.
Sample OnBefore Transform Script
---------------------------------------
if (action == 'update') {
if (target.active == false) {
ignore = true; } }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Rohith Sureshk1 !!
Use a Before Update script in your Transform Map to skip updates for inactive incidents and insert new records instead:
if (target.active == false) {
current = null; // forces insert instead of update
}Behavior:
Active incidents → update
Inactive incidents → insert new
No match → insert new
This lets your coalesce field update only active incidents and insert new ones for inactive matches.
Mark this as Helpful if it clarifies the issue.
Accept the solution if this answers your question.
Regards,
Vaishnavi
Associate Technical Consultant
