How to delete insert in import set

Mi1
Tera Contributor

Hi,

I'm using an import set.

I want to delete all the records in the table and insert them anew.

What kind of setup is possible?

Regards,

1 ACCEPTED SOLUTION

suvro
Mega Sage
Mega Sage

First delete all the records using background script. Then import the data

var delGr = new GlideRecord('table_name');

delGr.query();

delGr.deleteMultiple();

View solution in original post

9 REPLIES 9

suvro
Mega Sage
Mega Sage

First delete all the records using background script. Then import the data

var delGr = new GlideRecord('table_name');

delGr.query();

delGr.deleteMultiple();

Mi1
Tera Contributor

Hi,

Thank you. I want to do it automatically at the time of import, but do I need to respond manually?

 

Regards,

Hi,

Yes, you can use a transform map script to delete records but why not manually do it by simply navigating to Tables >> All. Search by Table name, Open the record & then use Delete All Records button.

How frequent is it & why is there a need to delete records always from target. If it is one time or two try above with no script involved i.e. simply using Delete All Records UI Action.

Mi1
Tera Contributor

Hi,

Thank you.

I don't import it manually.

The job(JDBC File Loader) moves at a fixed time every day and automatically imports data.

I can't work at a fixed time every day...

 

Regards,