Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Feb 9, 2023 10:02:12 AM
Mar 29, 2021 11:08:29 AM
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:
A customer uses Zoho CRM and the Salesforce platform and he wants to sync all his Zoho CRM contact objects to his Salesforce account. The issue is that currently, he has some contacts present on 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 the update is usually done on the first search result returned.
Example:
Now, a small issue might appear 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. 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.