- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2023 10:10 PM
Use Case:
Field Map:
ID (Coalesce)
Name
After executing transform map, I want to update a Comment field even though it was not updated during the transform due to No Value Changes.
How can I do this?
Thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2023 11:41 PM
Hi,
You can use below logic.
Create onAfter transform script and use below script logic to update comments:
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
if (source.sys_import_state == 'ignored') {
var recGr = new GlideRecord('incident'); // replace your table name
recGr.addQuery('sys_id', target.sys_id.toString());
recGr.query();
if (recGr.next()) {
recGr.comments = "Record is skipped during upload";
recGr.update();
}
}
})(source, map, log, target);
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2023 10:57 PM
Hi @ican ,
Have one more mapping for sys_updated field and set its value with a script gs.now(). By adding this new mapping, the system will make sure the record is updated every time when the record is imported irrespective of any value changed or not.
But I wouldn't recommend it for huge data imports on daily scheduled jobs as it will have a huge impact on performance.
Mark it as helpful and solution proposed if it serves your purpose.
Thanks,
Anand

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2023 11:41 PM
Hi,
You can use below logic.
Create onAfter transform script and use below script logic to update comments:
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
if (source.sys_import_state == 'ignored') {
var recGr = new GlideRecord('incident'); // replace your table name
recGr.addQuery('sys_id', target.sys_id.toString());
recGr.query();
if (recGr.next()) {
recGr.comments = "Record is skipped during upload";
recGr.update();
}
}
})(source, map, log, target);
Thanks
Anil Lande