Transform Map - Ignore Row if any fields are empty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2017 04:03 AM
Hello All,
When transforming an import set table. Is it possible to ignore any rows that have an empty field?
We want to ensure that all rows to be imported have complete information. Is there a transform script I can utilize to achieve this?
I have tried just using 'Enforce Mandatory Fields' but this doesn't work, the data is still imported with empty fields.
Many Thanks
Harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2017 04:35 AM
Hi Harry,
Have that script in onStart transform script and it will ignore entire transformation.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2017 04:51 AM
Sorry for being a bit dense here. How do I get this to run onStart?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2017 04:51 AM
Ignore this - found it!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2017 04:59 AM
I have added this into an onStart script.
The script is no longer working, all rows are being imported.
This was working for individual rows however I wasn't using it as a transform script. I had just checked the 'Run Script' checkbox on the transform map and entered it in there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2017 05:06 AM
This is the onStart script I am using:
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
if(source.u_model_category == '' || source.u_manufacturer == '' || source.u_state == '' || source.u_stockroom == '' || source.u_location == '' || source.u_serial_number == '' || source.u_warranty_expiration == '' || source.u_business_unit == '' || source.u_purchased == '' || source.u_asset_tag == '' || source.u_po_number == '' || source.u_cost == '' || source.u_model == '' || source.u_vendor == '')
{
ignore = true;
}
})(source, map, log, target);