A lot of use cases that appear when syncing objects between two platforms fall under the upsert category.
Let's take a practical example to make things more simple. Customer uses Zoho CRM and Salesforce platform and he wants to sync all his Zoho CRM contact objects to his Salesforce account. Issue is that currently he has some contacts present in both platforms and when he is doing the full sync he doesn't want any duplicates added in his Salesforce account.
Here is where an upsert pattern comes in. After getting all the contacts in Zoho we can use a search endpoint from the Salesforce platform to check if it already exists or not. Then a condition block is added to see if that search returned any results: if there are results in the history of the block, contact is already present on the platform and we need to update that result, otherwise a new contact has to be created.
Following is an image of how the integration flow should look like:
For the update block we can use the contact id that was found with the search block. In most cases the search will return a list so update is usually done on the first search result returned like in the example image:
Now, a small issue might appear for some platforms when using a search or filter block. Some of them, when no contact has been found, return an error and that would mean our integration would fail which we don't want. In order to avoid this we will need to change the "On error " selection on the search block to "Ignore - Continue blend and ignore errors".
That way the integration will continue running until it finished iterating through all of the Zoho contacts.