Schedule import_ post execute script

ram11vrnr
Tera Contributor

Hi,

I have created a schedule import, in which i have wrote below script to remove the attacment from the particular data source record once import set processed. 

 

Now i want to attach the same attachment in the respective import set record (sys_import_set)table., so that i future we have reference what changes done in the file while loading data.

 

Please let me know how can i attach the file in import set record which is removed from datasource.

 

 

var attachment = new GlideSysAttachment();
var agr = attachment.getAttachments('sys_data_source', 'c1234567b45ad10a169dd72b24bcb1b');
while(agr.next()) {
attachment.deleteAttachment(agr.sys_id);
gs.info(agr.getValue('file_name'));
}

 

Thanks in advance

1 REPLY 1

Richard Hine
Tera Guru
Tera Guru

ram11vrnr,

 

Can I please clarify your use case? You want to effectively move an attachment from the sys_data_source record to the import set record as a reference?

 

Surely this will become quickly unmanageable with many attachments associated with the import set record?

 

Have I misunderstood?

 

Richard