How to ignore blank fields in Transform Map?

tahnalos
Kilo Sage

So I'm doing my 10th import into a very large table (10,000 entries) and I notice that this latest dump has half the rows missing a bunch of fields.  As a result, when I perform this import, it overrides the data already in the table with blanks.  I have asked for a more complete dump but due to the urgency of this import (they want the data that is populated in the table ASAP), I need to come up with a solution that will allow me to ignore certain field imports if the field in the map is blank.  Obviously, I need a field level import but not sure how to pull it off.  Splitting the import will not be an option as some of these fields that are missing data are not mutually exclusive  meaning the split would need to be complicated.

Ideas?

 

9 REPLIES 9

sachin_namjoshi
Kilo Patron
Kilo Patron

Have this script in the onBefore transform script

 

 

 

if(source.u_field1 == '' && source.u_field2 == '' && source.u_field3 == '')

 

  {

 

  ignore = true;

 

  }

 

 

 

you will have to repeat the AND condition for all the fields you wanted to check with

 

Regards,

Sachin

That's not what I want.

We want the import to go ahead, but only with the fields that has value.  If the import field has no value, the FIELD should not be imported but the rest of the data should go ahead.

We need to do this because the latest drop is missing pieces of data and instead of waiting for a more complete drop which could take weeks, we want to import what data we have.  However, the blank fields are overwriting those fields that actually have data which is what we don't want.

you can use field level script in transform map to import data for field only if it contains value.

 

Below is example

 

find_real_file.png

 

Regards,

Sachin

DirkRedeker
Mega Sage
Hi I think there is a import property you can set to control, how to cope with empty fields... You can set to ignore, or overwrite with empty values. See here in the documentation: https://docs.servicenow.com/bundle/madrid-platform-administration/page/administer/import-sets/reference/r_ImportSetsProperties.html The name of the property is glide.impex.transformer.empty_value_nil Let me know if that answered your question and mark as correct or helpful. BR Dirk