Data was loading very slowly, due to transform map scrips

harish mandhula
Tera Contributor

We have on before and on after transform map scripts, when we are doing data load the records was inserting very slowly. It was taking lot of time to insert the records.

To avoid this what  we can do, please let us know

7 REPLIES 7

OlaN
Giga Sage
Giga Sage

Hi,

You can share your scripts here, and the community might be able to share some optimization to make it run faster.

on before transform map script:

target.imported=true;

onAfter transform map script:

var targetrecords =new GlideRecord('incident');
targetrecords.addQuery('imported',false);
targetrecords.addQuery('incident_id',source.u_incident_id);
targetrecords.query();
while(targetrecords.next()){
targetrecords.active_user = false;
targetrecords.update();

}

HI @harish mandhula ,

 

Can update your onAfter script as below :

 

var targetrecords =new GlideRecord('incident');
if(targetrecords.get('incident_id',source.u_incident_id)){
if(targetrecords.imported==false)
{
targetrecords.active_user = false;
targetrecords.update();
}
}

Please mark the answer correct/helpful based on Impact.
Regards, Shekhar

is it work for large number of records, and will it load fastly.