Posted on 28/08/2024 15:27:37
Hi,
@Arian @Imar just my personal opinion (and recomendation): I would never rely on that checkbox for interacting with live data. Let's say one morning something has gone wrong, and the data source is empy? Or Dynamicweb was updated to another ring, and they forgot to test that setting? You risk accidentally deleting all products, which the customer may have put a lot of effort into enriching in PIM, or may even have paid someone to do. It's IT, so you should expect whatever that can go wrong to actually go wrong. I've previously used "Deactivate missing rows", exactly to avoid loosing data, but that only goes for products when using the Dynamicweb provider. But in multiple scenarios, I've been glad I did it.
For many years we've been wishing for a data proofing area in Dynamicweb, where we could set up rules for verifying the quality of data before actually committing data changes to our production tables, but this has never been a focus in the product. So, another approach, which can also be applied here, is to set up your own proofing area using staging tables where you import data to from the actual source, and then create SQL views in which you can apply different rules, and using the views to import to your actual destination. In you scenario you can create a view to feed a dedicated job with "Deletre incoming rows", so that rather than relying on the provider logic, you can apply your own rules.
I've made an simple example here based on a staging setup for EcomPrices that I happened to have at hand. The situation is, that I have 12 records in EcomPrices, that are not in my staging table, so these should be removed from EcomPrices:
The deleteprice column indicates whether it's safe to remove the record. In this scenario I'm just checking that the staging table is not empty, but this could of cause be more sophisticated. So, In the data intgration activity I would make a conditional for "deleteprice equals true", so if my rule indicates that it is safe to delete, we go ahead and delete.
If I change my rule, just for the example here, so no records are returned, then the deleteprice column contains false, and with the conditional in the mapping, nothing gets deleted:
So, rather than relying on this and that checkbox in the UI, you can take control of the process and make an educated assesment of what it is actually safe to remove or - preferably - deactivate. As @Imar suggests, tagging records with the source allows you to delete within a limited range of records and not the entire table, and then the trick is just to build that into the rule.
Br.
Lars