- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2018 07:16 PM
Hi Experts,
I have requirement entire import set need to ignore if particular field is nil.
Eg - Excel sheet have 10 rows. At row 9th field x==nil then entire transaction need to ignore/skip/kill
How to achieve this scenario?
I have search other community result but not able find exact result.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2018 07:01 PM
Ah ok, onStart might be a better call as the script will halt the entire transform map, rather than running the same script on every row. I didn't realize setting ignore to true in an onStart script did that.
If I'm not mistaken I think he does want it to be a specific field that's null rather than any field, but it should halt if null in any row. I did forget to query for the specific import set in my previous example. However you should use import_set.sys_id, not map.sys_id. So here's the edited solution:
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
var gr = new GlideRecord('u_data_source');
gr.addQuery('sys_import_set', import_set.sys_id);
gr.addNullQuery('field_x');
gr.query();
if(gr.next()) {
ignore = true;
}
})(source, map, log, target);
Run this onStart, and it should work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2018 10:48 PM
thanks, Chris Sanford
Finally, the requirement has completed. 🙂