Transform map delete records

Ellie2
Kilo Expert

Hi All,

I need to recurring load data using transform map and if on any reloads a record initially added with the TM is no longer in the load file I need to delete this record from the table.

How could I best accomplish this. Any suggestions welcome.

Thanks

1 ACCEPTED SOLUTION

Tony Chatfield1
Kilo Patron

Hi, I do not recommend deleting data as this impacts other records if the data is mapped anywhere, and may cause issues with historical reporting.
IE a historical incident will no longer show correct CI details if the reference CI record is deleted.

A better solution is to set an active\inactive field on the target table and the use QBR\reference qualifiers to hide the inactive data from users who do not need to see it.

If you must delete data then I would consider an onComplete transform script.
After your import\transform is finished loop through your target table and for every record,
query your source(import) table for matching records for your data\time range (IE created in last X minutes) filtering on field(s) your transform coalesces on.
If a match is not found in the source table then delete the target record.

View solution in original post

1 REPLY 1

Tony Chatfield1
Kilo Patron

Hi, I do not recommend deleting data as this impacts other records if the data is mapped anywhere, and may cause issues with historical reporting.
IE a historical incident will no longer show correct CI details if the reference CI record is deleted.

A better solution is to set an active\inactive field on the target table and the use QBR\reference qualifiers to hide the inactive data from users who do not need to see it.

If you must delete data then I would consider an onComplete transform script.
After your import\transform is finished loop through your target table and for every record,
query your source(import) table for matching records for your data\time range (IE created in last X minutes) filtering on field(s) your transform coalesces on.
If a match is not found in the source table then delete the target record.