<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>article Qlik Application Automation: How to build an upsert (create or update) pattern in Official Support Articles</title>
    <link>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Application-Automation-How-to-build-an-upsert-create-or/ta-p/1795356</link>
    <description>&lt;P&gt;A lot of use cases that appear when &lt;STRONG&gt;syncing objects&lt;/STRONG&gt; between two platforms fall under the upsert category.&lt;/P&gt;
&lt;P&gt;Let's take a practical example to make things more simple:&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;Here is where an &lt;STRONG&gt;&lt;FONT color="#339966"&gt;upsert pattern&lt;/FONT&gt; &lt;/STRONG&gt;comes in.&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;Following is an image of how the integration flow should look like:&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="upsert pattern Automation.png" style="width: 481px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/100083i1BE6BACFB2F0B9A4/image-size/large?v=v2&amp;amp;px=999" role="button" title="upsert pattern Automation.png" alt="upsert pattern Automation.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="selection of items.png" style="width: 519px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/100084iB0252F6B621ED774/image-size/large?v=v2&amp;amp;px=999" role="button" title="selection of items.png" alt="selection of items.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;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 &lt;FONT color="#339966"&gt;&lt;STRONG&gt;On error&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;selection on the search block to &lt;FONT color="#339966"&gt;&lt;STRONG&gt;Ignore - Continue blend and ignore errors&lt;/STRONG&gt;&lt;/FONT&gt;.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Search Contacts by email.png" style="width: 477px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/100085i105A4667F48BAA95/image-size/large?v=v2&amp;amp;px=999" role="button" title="Search Contacts by email.png" alt="Search Contacts by email.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;That way the integration will continue running until it finished iterating through all of the Zoho contacts.&lt;/P&gt;</description>
    <pubDate>Thu, 09 Feb 2023 15:02:12 GMT</pubDate>
    <dc:creator>Marius_Nuca</dc:creator>
    <dc:date>2023-02-09T15:02:12Z</dc:date>
    <item>
      <title>Qlik Application Automation: How to build an upsert (create or update) pattern</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Application-Automation-How-to-build-an-upsert-create-or/ta-p/1795356</link>
      <description>&lt;P&gt;A lot of use cases that appear when &lt;STRONG&gt;syncing objects&lt;/STRONG&gt; between two platforms fall under the upsert category.&lt;/P&gt;
&lt;P&gt;Let's take a practical example to make things more simple:&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;Here is where an &lt;STRONG&gt;&lt;FONT color="#339966"&gt;upsert pattern&lt;/FONT&gt; &lt;/STRONG&gt;comes in.&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;Following is an image of how the integration flow should look like:&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="upsert pattern Automation.png" style="width: 481px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/100083i1BE6BACFB2F0B9A4/image-size/large?v=v2&amp;amp;px=999" role="button" title="upsert pattern Automation.png" alt="upsert pattern Automation.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="selection of items.png" style="width: 519px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/100084iB0252F6B621ED774/image-size/large?v=v2&amp;amp;px=999" role="button" title="selection of items.png" alt="selection of items.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;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 &lt;FONT color="#339966"&gt;&lt;STRONG&gt;On error&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;selection on the search block to &lt;FONT color="#339966"&gt;&lt;STRONG&gt;Ignore - Continue blend and ignore errors&lt;/STRONG&gt;&lt;/FONT&gt;.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Search Contacts by email.png" style="width: 477px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/100085i105A4667F48BAA95/image-size/large?v=v2&amp;amp;px=999" role="button" title="Search Contacts by email.png" alt="Search Contacts by email.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;That way the integration will continue running until it finished iterating through all of the Zoho contacts.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 15:02:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Application-Automation-How-to-build-an-upsert-create-or/ta-p/1795356</guid>
      <dc:creator>Marius_Nuca</dc:creator>
      <dc:date>2023-02-09T15:02:12Z</dc:date>
    </item>
  </channel>
</rss>

