<?xml-stylesheet type="text/xsl" href="https://sugarclub.sugarcrm.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Upsert as explained by &amp;quot;Upsert&amp;quot;</title><link>/dev-club/b/dev-blog/posts/upsert-explained-by-upsert</link><description>Let&amp;rsquo;s talk about Upsert - not to be confused with our company of the same name. Upsert API endpoints are an incredible time saver. Have your integrations become cumbersome ? Much like that 90&amp;rsquo;s band Seven Mary Three, we want to avoid this ...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Upsert as explained by &amp;quot;Upsert&amp;quot;</title><link>https://sugarclub.sugarcrm.com/dev-club/b/dev-blog/posts/upsert-explained-by-upsert</link><pubDate>Thu, 11 May 2023 12:54:12 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:ee4e37db-9be2-4bb7-8dd6-1e52f3f2fe1e</guid><dc:creator>shreya dalvi</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;HI All,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;We are calling bulk UPSERT Api in sugar integrate tool and we have some relationship fields also to update but we have only related record name, what is best way to handle relationship fields in bulk upsert.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;Means &lt;span style="font-size:12px;"&gt;suppose,&lt;/span&gt;&amp;nbsp;we are &lt;span style="font-size:12px;"&gt;using&lt;/span&gt;&amp;nbsp;bulk upsert API for accounts module and we have relationship field of contact but in integration we have only contact name ,not contact id then&amp;nbsp;to get contact id we have to call contact api and then we have pass it to upsert api but in that we approach we &lt;span style="font-size:12px;"&gt;can&amp;#39;t&lt;/span&gt;&amp;nbsp;user bulk approach we have to call upsert in sequential way and which leads to performance &lt;span style="font-size:12px;"&gt;bottleneck&lt;/span&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Same issue we have for Assigned to user field we have only user name and to get user id we have to call user api, same with teams.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Can anyone suggest how to handle this with bulk approach?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kindest Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Shreya&lt;/span&gt;&lt;/p&gt;&lt;img src="https://sugarclub.sugarcrm.com/aggbug?PostID=1528&amp;AppID=56&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Upsert as explained by &amp;quot;Upsert&amp;quot;</title><link>https://sugarclub.sugarcrm.com/dev-club/b/dev-blog/posts/upsert-explained-by-upsert</link><pubDate>Thu, 11 May 2023 12:09:22 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:ee4e37db-9be2-4bb7-8dd6-1e52f3f2fe1e</guid><dc:creator>shreya dalvi</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Dear Jerry,&lt;/p&gt;
&lt;p&gt;Thanks for information!!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;We are using Upsert API for bulk records means we are sending bulk records to UPSERT API to reduce multiple API hits for found and create&amp;nbsp; record, but we want to log error if any new record is creating can you please guide on how to deal with this scenario?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Note: We are calling bulk UPSERT Api in sugar integrate tool.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kindest Regards,&lt;/p&gt;
&lt;p&gt;Shreya&lt;/p&gt;&lt;img src="https://sugarclub.sugarcrm.com/aggbug?PostID=1528&amp;AppID=56&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Upsert as explained by &amp;quot;Upsert&amp;quot;</title><link>https://sugarclub.sugarcrm.com/dev-club/b/dev-blog/posts/upsert-explained-by-upsert</link><pubDate>Thu, 06 May 2021 15:54:35 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:ee4e37db-9be2-4bb7-8dd6-1e52f3f2fe1e</guid><dc:creator>Damien Pochon</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;This is great!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is this included in&amp;nbsp;all Sugar editions (PRO, ENT, Sell, SERVE) or does it require an Integrate subscription (as the endpoint&amp;#39;s URL could lead one to think)?&lt;/p&gt;&lt;img src="https://sugarclub.sugarcrm.com/aggbug?PostID=1528&amp;AppID=56&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Upsert as explained by &amp;quot;Upsert&amp;quot;</title><link>https://sugarclub.sugarcrm.com/dev-club/b/dev-blog/posts/upsert-explained-by-upsert</link><pubDate>Thu, 15 Apr 2021 21:31:48 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:ee4e37db-9be2-4bb7-8dd6-1e52f3f2fe1e</guid><dc:creator>sophie sun</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Great stuff, thanks Jerry.&lt;/p&gt;
&lt;p&gt;Just one more question,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;say if I have 80K contacts to be upserted. Is there a way to bulk upsert them or we need a loop to loop all contacts and do the upsert?&amp;nbsp;&lt;br /&gt;Thank you very much!&lt;/p&gt;&lt;img src="https://sugarclub.sugarcrm.com/aggbug?PostID=1528&amp;AppID=56&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Upsert as explained by &amp;quot;Upsert&amp;quot;</title><link>https://sugarclub.sugarcrm.com/dev-club/b/dev-blog/posts/upsert-explained-by-upsert</link><pubDate>Thu, 12 Nov 2020 22:31:20 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:ee4e37db-9be2-4bb7-8dd6-1e52f3f2fe1e</guid><dc:creator>Enrico Simonetti</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Great post [mention:5197d085ea35495a887d0716d85e4726:e9ed411860ed4f2ba0265705b8793d05] for our integration enthusiasts!&lt;/p&gt;
&lt;p&gt;A few clarifications/additions to add a little more colour:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;sync_key values have to be unique on the same object/module, an exception will be thrown otherwise&lt;/li&gt;
&lt;li&gt;there is &lt;a href="https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_10.2/Integration/Web_Services/REST_API/Endpoints/Integratemodulerecord_idsync_key_field_namesync_key_field_value_PUT/"&gt;an endpoint specifically used to set a sync_key for an existing record&lt;/a&gt; that can be used as well, alternatively for new records, the sync_key will be set automatically&amp;nbsp;&lt;/li&gt;
&lt;li&gt;if&amp;nbsp;there is the need&amp;nbsp;to add a new sync_key type field (to deal with multiple integrations on the same module), make sure you follow the structure of the matching vardefs (include/SugarObjects/implements/integrate_fields/vardefs.php), also make sure the field is on the main module&amp;#39;s table and has an index/unique clause for performance reasons&lt;/li&gt;
&lt;li&gt;last but not least, for integrations you can wrap all the upsert calls into a bulk single http call, to improve further the throughput. Given that there is no need to know the &amp;quot;previous record&amp;#39;s id&amp;quot; as the integration uses the external records identifiers to identify a record, this can be done easily for a number of operations on the same bulk api call!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Hope it helps!&lt;/p&gt;&lt;img src="https://sugarclub.sugarcrm.com/aggbug?PostID=1528&amp;AppID=56&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Upsert as explained by &amp;quot;Upsert&amp;quot;</title><link>https://sugarclub.sugarcrm.com/dev-club/b/dev-blog/posts/upsert-explained-by-upsert</link><pubDate>Thu, 12 Nov 2020 16:46:53 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:ee4e37db-9be2-4bb7-8dd6-1e52f3f2fe1e</guid><dc:creator>Jeff Bickart</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Jerry - Thanks for the post!&lt;/p&gt;&lt;img src="https://sugarclub.sugarcrm.com/aggbug?PostID=1528&amp;AppID=56&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>