When syncing data between two applications, most
integrations only sync new and updated data. But some applications allow the deleting
of data, and you may wish to include data deletions in your integration by
deleting the corresponding data from the other application as well. For example, you may no longer want the
deleted data to be included in your data warehouse.
The complexity of doing so can vary based on whether
‘deleting’ the data truly deletes the data from the database or simply sets a
deleted flag, and whether the APIs allow you to access any flagged records in
the latter situation.
When data is deleted in Creatio, it is fully deleted from
the database. This means there is nothing to query on to identify deleted data,
making it more difficult to sync deletions. But there are ways to work around
To start with, you can create a Process with a Signal start
event, triggered by the deleting of a record. Here’s an example of what that
might look like for a deleted Account.
If you only sync a subset of data in your integration, you can setup the filter conditions to only trigger the process for the same subset of data.
Your process will then be able to reference the ID of the
deleted record. As long as you store that ID in the integrated application, you
can match on that ID to find and delete the corresponding record.
If your integration uses a batch sync approach, you’ll need
to store this ID somewhere in Creatio until the next sync runs. I created a
simple custom Section to hold the record type and ID.
Note: The record type is important if you intend to sync
deletions from multiple sections – you would also need multiple processes, one
per section, in this scenario.
With this approach, your process would simply add a row to the section, setting the record type and passing in the ID of the deleted record. You can then query the section to find any newly deleted records and process deletion in the other application.
Alternately, if your integration uses real-time API calls or webhooks, you can call the API (or webhook) from your process, passing in the ID of the deleted record, using the Call web service element.