Data was loading very slowly, due to transform map scrips
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2023 11:35 PM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2023 11:37 PM
Hi,
You can share your scripts here, and the community might be able to share some optimization to make it run faster.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2023 11:52 PM
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();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2023 11:59 PM
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();
}
}
Regards, Shekhar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2023 12:03 AM
is it work for large number of records, and will it load fastly.