<?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>topic Re: ZOHO API with Qlik REST Connector and table transpose in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/ZOHO-API-with-Qlik-REST-Connector-and-table-transpose/m-p/1524961#M438328</link>
    <description>Hi,&lt;BR /&gt;First of all I wanted to say thank you very much for the code, it helped me a lot.&lt;BR /&gt;I was able to set up and get the correct data for Potentials module.&lt;BR /&gt;But for some reason I tried to define the same thing as the contacts module but I can not,&lt;BR /&gt;Can you help me - which code lines need to be changed?&lt;BR /&gt;Of course, I changed the API URL, etc.&lt;BR /&gt;&lt;BR /&gt;thank u</description>
    <pubDate>Sat, 29 Dec 2018 23:12:09 GMT</pubDate>
    <dc:creator>hagay</dc:creator>
    <dc:date>2018-12-29T23:12:09Z</dc:date>
    <item>
      <title>ZOHO API with Qlik REST Connector and table transpose</title>
      <link>https://community.qlik.com/t5/QlikView/ZOHO-API-with-Qlik-REST-Connector-and-table-transpose/m-p/1100278#M365127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I struggled with this for a while so I thought I'd share how to get data from the Zoho API&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;1. Check that your ZOHO API works&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Create your token and test the ZOHO API.&amp;nbsp; Start with a simple URL in a browser to make sure that your token works. Google Zoho API for help on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;2. Install / Configure the Qlik REST Connector&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Download and install the REST Connector from Qlik Market.&amp;nbsp; Currently here: &lt;A href="http://market.qlik.com/rest-connector.html" title="http://market.qlik.com/rest-connector.html"&gt;REST Connector&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In Sense, &lt;STRONG&gt;Create new connection&lt;/STRONG&gt;.&amp;nbsp; (Note, I'm using the ZOHO API method that references a custom view but you can adapt this for other API methods.&amp;nbsp; A custom view lets me filter the records and choose the fields that I want.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;Rest Connector Parameters&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;URL&lt;/STRONG&gt;: &lt;A href="https://crm.zoho.com/crm/private/xml/Potentials/getCVRecords" title="https://crm.zoho.com/crm/private/xml/Potentials/getCVRecords"&gt;https://crm.zoho.com/crm/private/xml/Potentials/getCVRecords&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Method&lt;/STRONG&gt;: Get&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Query Parameters:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;scope: crmapi&lt;/P&gt;&lt;P&gt;cvName: The name of your custom view - in my case it's: All Open Opportunities&lt;/P&gt;&lt;P&gt;authtoken: 1234abcd...&amp;nbsp;&amp;nbsp;&amp;nbsp; (put in your real token so you can use the "Test Connection" button&lt;/P&gt;&lt;P&gt;newFormat: 1 or 2&amp;nbsp; (depends if you want null fields with the text "null" in them)&lt;/P&gt;&lt;P&gt;fromIndex: 1&lt;/P&gt;&lt;P&gt;toIndex: 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (default to one record for testing - we will update this from the Qlik Script)&lt;/P&gt;&lt;P&gt;Now Test Connection.&amp;nbsp; Should return "Test was successful"&lt;/P&gt;&lt;P&gt;Save this with a name to use in Qlik, in my example it is "Zoho Opportunities"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;3. Create the Qlik Script&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Start by connecting to the connection that you created in part 2 and generate a script automatically.&amp;nbsp; That is the heart of this code.&amp;nbsp; You should test that and then add the loops and transpose from this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the full Qlik Script with some explanation &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let pageSize = 20;&amp;nbsp; // how many records in one call - try 100 for efficiency&lt;/P&gt;&lt;P&gt;Let fromIndex = 1;&lt;/P&gt;&lt;P&gt;Let vTableRows = 0;&amp;nbsp; // how many rows fetched so far, each record may be 35 rows of fields&lt;/P&gt;&lt;P&gt;Let vAuthToken = '6c5f0f384e8b3eb5a7c890e7';&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // not my real token - use your own&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LIB CONNECT TO 'Zoho Opportunities';&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // match to the connection name created in 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO &lt;/P&gt;&lt;P&gt;&amp;nbsp; Let toIndex = (fromIndex + pageSize - 1);&lt;/P&gt;&lt;P&gt;&amp;nbsp; //trace "fromIndex: " $(fromIndex);&lt;/P&gt;&lt;P&gt;&amp;nbsp; //trace "toIndex: " $(toIndex);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; RestConnectorMasterTable:&lt;/P&gt;&lt;P&gt;&amp;nbsp; SQL SELECT &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "__KEY_response",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (SELECT &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (SELECT &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (SELECT &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (SELECT &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "attr:val" AS "val",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "@Content",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "__FK_FL"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM "FL" FK "__FK_FL" ContentFieldAlias "@Content")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM "row" PK "__KEY_row" FK "__FK_row")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM "Potentials" PK "__KEY_Potentials" FK "__FK_Potentials")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM "result" PK "__KEY_result" FK "__FK_result")&lt;/P&gt;&lt;P&gt;&amp;nbsp; FROM XML "response" PK "__KEY_response"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // the script above was generated automatically from the data.&amp;nbsp; It's a bit different if you use JSON instead of CSV&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; // I just took out the closing ; and added the next bit.&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Pass some parameters to the REST Connector to overwrite the Query Parameters&lt;/P&gt;&lt;P&gt;&amp;nbsp; // You can pass the URL if you want the connection to be more generic. &lt;/P&gt;&lt;P&gt; // See the documentation on the REST connector - search qlik rest connection help&lt;/P&gt;&lt;P&gt;&amp;nbsp; WITH CONNECTION (&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QUERY "fromIndex" "$(fromIndex)",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QUERY "toIndex" "$(toIndex)",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QUERY "authtoken" "$(vAuthToken)"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ); &lt;/P&gt;&lt;P&gt;&amp;nbsp; // Need to check if we fetched more than one row&lt;/P&gt;&lt;P&gt;&amp;nbsp; Let rowsFetched = NoOfRows('RestConnectorMasterTable') - vTableRows;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //trace "rowsFetched: " $(rowsFetched);&lt;/P&gt;&lt;P&gt;&amp;nbsp; Let vTableRows = vTableRows + rowsFetched;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Let fromIndex = fromIndex + pageSize;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;LOOP while rowsFetched &amp;gt; 1;&lt;/P&gt;&lt;P&gt;// use &amp;gt;1 because even once we run out of data we still get 1 row of response&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[FL]:&lt;/P&gt;&lt;P&gt;LOAD&amp;nbsp;&amp;nbsp; [__FK_FL] AS KEY_row, val, @Content&amp;nbsp;&amp;nbsp; // Warning, I changed the name of the ___Key_Row field from the auto script.&lt;/P&gt;&lt;P&gt;RESIDENT RestConnectorMasterTable&lt;/P&gt;&lt;P&gt;WHERE NOT IsNull([__FK_FL]);&lt;/P&gt;&lt;P&gt;DROP TABLE RestConnectorMasterTable;&lt;/P&gt;&lt;P&gt;//FL is a table with a separate row for each field which is useless unless transposed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// So now we use Generic Load to pull the data out of this horrible structure&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;//see &lt;/SPAN&gt;&lt;A class="jive-link-blog-small" data-containerid="2588" data-containertype="37" data-objectid="3629" data-objecttype="38" href="https://community.qlik.com/blogs/qlikviewdesignblog/2014/03/31/generic"&gt;https://community.qlik.com/blogs/qlikviewdesignblog/2014/03/31/generic&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Table2:&lt;/P&gt;&lt;P&gt;Generic LOAD *&lt;/P&gt;&lt;P&gt;Resident FL;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// It's OK to use the data as many separate tables - it may be more efficient.&lt;/P&gt;&lt;P&gt;// if you are OK with this, just drop FL and exit here.&lt;/P&gt;&lt;P&gt;// This last bit brings it all toghether into one table&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;// adapted from &lt;/SPAN&gt;&lt;A class="jive-link-wiki-small" data-containerid="2049" data-containertype="14" data-objectid="3020" data-objecttype="102" href="https://community.qlik.com/docs/DOC-3020"&gt;https://community.qlik.com/docs/DOC-3020&lt;/A&gt;&lt;/P&gt;&lt;P&gt;ResultTable:&lt;/P&gt;&lt;P&gt;LOAD Distinct KEY_row Resident FL;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR i = 0 to NoOfTables()&lt;/P&gt;&lt;P&gt;&amp;nbsp; TableList:&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAD TableName($(i)) as Tablename AUTOGENERATE 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; WHERE WildMatch(TableName($(i)), 'Table2.*');&lt;/P&gt;&lt;P&gt;NEXT i&lt;/P&gt;&lt;P&gt;FOR i = 1 to FieldValueCount('Tablename')&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vTable = FieldValue('Tablename', $(i));&lt;/P&gt;&lt;P&gt;&amp;nbsp; LEFT JOIN (ResultTable) LOAD * RESIDENT [$(vTable)];&lt;/P&gt;&lt;P&gt;&amp;nbsp; DROP TABLE [$(vTable)];&lt;/P&gt;&lt;P&gt;NEXT i&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Tables FL, TableList;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #575757; text-decoration: underline;"&gt;More links&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.zoho.com/crm/help/api/" title="https://www.zoho.com/crm/help/api/"&gt;Zoho CRM API | Developer Help - Zoho CRM&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://market.qlik.com/rest-connector.html" title="http://market.qlik.com/rest-connector.html"&gt;REST Connector&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-13585"&gt;QlikView - Using the REST Connector&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/3629"&gt;The Generic Load&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 May 2016 06:27:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ZOHO-API-with-Qlik-REST-Connector-and-table-transpose/m-p/1100278#M365127</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-09T06:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: ZOHO API with Qlik REST Connector and table transpose</title>
      <link>https://community.qlik.com/t5/QlikView/ZOHO-API-with-Qlik-REST-Connector-and-table-transpose/m-p/1100279#M365128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Update for Qlik Sense 3.1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;My script started failing around October 2016 when we upgraded the server to QS 3.1.&amp;nbsp; It still worked on my 3.0 desktop so I don't know what Qlik changed.&amp;nbsp; On the QS 3.1 server it was doing a cartesian join while looping through Tablename.&amp;nbsp; This was caused by the REST API call returning duplicate record keys where there were two opportunities (Potentials) for the same Account.&amp;nbsp; The effect was that instead of 100 records, it was generating 100 million records which took 2 hours and caused the server to slow down. MY QS dashboard showed over $1 trillion in likely sales which would be great if it were real &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When we changed the &lt;STRONG&gt;Key generation strategy&lt;/STRONG&gt; in the REST connector from &lt;STRONG&gt;SequenceID&lt;/STRONG&gt; to &lt;STRONG&gt;Fully qualified record&lt;/STRONG&gt;, this problem went away.&lt;/P&gt;&lt;P&gt;Please mark this as "Helpful" so I get some points - it took a lot of work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 05:56:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ZOHO-API-with-Qlik-REST-Connector-and-table-transpose/m-p/1100279#M365128</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-10-19T05:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: ZOHO API with Qlik REST Connector and table transpose</title>
      <link>https://community.qlik.com/t5/QlikView/ZOHO-API-with-Qlik-REST-Connector-and-table-transpose/m-p/1100280#M365129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I followed the steps but I got error 4600, "unable to process your request" from zoho. Could you advise know what could have gone wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Nov 2016 05:47:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ZOHO-API-with-Qlik-REST-Connector-and-table-transpose/m-p/1100280#M365129</guid>
      <dc:creator>guruprem</dc:creator>
      <dc:date>2016-11-29T05:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: ZOHO API with Qlik REST Connector and table transpose</title>
      <link>https://community.qlik.com/t5/QlikView/ZOHO-API-with-Qlik-REST-Connector-and-table-transpose/m-p/1524961#M438328</link>
      <description>Hi,&lt;BR /&gt;First of all I wanted to say thank you very much for the code, it helped me a lot.&lt;BR /&gt;I was able to set up and get the correct data for Potentials module.&lt;BR /&gt;But for some reason I tried to define the same thing as the contacts module but I can not,&lt;BR /&gt;Can you help me - which code lines need to be changed?&lt;BR /&gt;Of course, I changed the API URL, etc.&lt;BR /&gt;&lt;BR /&gt;thank u</description>
      <pubDate>Sat, 29 Dec 2018 23:12:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ZOHO-API-with-Qlik-REST-Connector-and-table-transpose/m-p/1524961#M438328</guid>
      <dc:creator>hagay</dc:creator>
      <dc:date>2018-12-29T23:12:09Z</dc:date>
    </item>
  </channel>
</rss>

