Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!

Qlik Application Automation: How to build an upsert (create or update) pattern

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Marius_Nuca
Support
Support

Qlik Application Automation: How to build an upsert (create or update) pattern

Last Update:

Feb 9, 2023 10:02:12 AM

Updated By:

Sonja_Bauernfeind

Created date:

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:

upsert pattern Automation.png

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:

selection of items.png

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.

Search Contacts by email.png

That way the integration will continue running until it finished iterating through all of the Zoho contacts.

Labels (2)
Version history
Last update:
‎2023-02-09 10:02 AM
Updated by: