Issue with target field's default value in dictionary

Developer3
Tera Expert

I am getting source data in excel where country is blank for few records. When i transform the data using below script- 

 

if(source.u_country)

      return source.u_country;

return '';

 

target field is being set as USA for those records. That's because "Country" field's dictionary default value is set as USA.

I tried onAfter script by setting these target field values as '' but still the value is USA. Please let me know how to fix it.

2 REPLIES 2

ShubhamGarg
Kilo Sage

Hello @Developer3 ,

 

In both onBefore and onAfter, dictionary value would take precedence when country value is transforming as empty.

 

In such scenarios, you can either abort the creation of such records. To help you further, can you let me know the exact business use case?

 

Hope it helps.

Regards,

Shubham

Musab Rasheed
Tera Sage
Tera Sage

Hello,

Since this is set at dictionary level of the field I don't think transform scripts will help, Try creating before BR on target table and set country to blank in case it is coming from import set. If this doesn't work then try changing default USA value from dictionary to some scripts to make sure it doesn't set for import set data.

Please hit like and mark my response as correct if that helps
Regards,
Musab