Transform Map inserts multiple records in user table!!

Rakhesh
Kilo Guru

Hi Guys,

We are troubling with one issue using transform map. Briefly, We are getting the data form database view by using transform maps we are insert into user table.So we gave Coalesce to one unique field, still we are getting duplicate records in user table.

we are noticing the issue i.e., example if user has a different emails then it is inserting into user table.we have an unique email i'd and ending with our 'company name'. So we need only those records. How we can achieve this ??? 

 

Thanks,

Rakhesh

1 ACCEPTED SOLUTION

Hi Rakhesh,

 

Please mark it as correct or helpful if the issue is resolved.

 

Regards,

Ram M

View solution in original post

10 REPLIES 10

rammohanraomadd
Kilo Guru

Hi Rakhesh,

 

Please correct if my understanding is wrong. There were multiple users getting inserted for single users, this is because of multiple emails for the single user. And you need to insert or update the user with email ending with company name.

Please try using the onbefore transform script in order to abort the insertion of error records.

 

Regards,

Ram M

Hi Ram,

Thanks for replay, yes we tried onbefore transform script,still no luck. If you know please can you guide me to achieve this using of onbefore transform script.

 

Thanks,

Rakhesh

Hi Rakhesh,

 

Could you please provide the script that you have tried with.

 

Regards,

Ram M

HI Ram,

 

we are using this code but not sure we are freshers in servicenow if we are wrong guide me.

the code which we wrote is in beow

 

var email= source.u_emailid;

var gr = new GlideRecord('sys_user');

gr.addQuery('u_email', empId);

gr.query();

while(gr.next()){

  if(action == insert){

  ignore = true;

}

 

Thanks,

Rakhesh