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
4 hours 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 hours 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 hours ago - last edited 3 hours 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 hours ago
What's your use case? Why are you updating Incidents through import set and transform map? What are you transforming?
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
