<?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: Create from value a valid iterable object in REST automation in Qlik Automate</title>
    <link>https://community.qlik.com/t5/Qlik-Automate/Create-from-value-a-valid-iterable-object-in-REST-automation/m-p/2043298#M1398</link>
    <description>&lt;P&gt;I would go for the flatten solution. Another option is to load the data in a qs app and store it as csv and then use QAA to only upload the data to snowflake. You could also do an sql insert directly in qs script if you do not need any other features of QAA&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Feb 2023 16:09:58 GMT</pubDate>
    <dc:creator>blaise</dc:creator>
    <dc:date>2023-02-28T16:09:58Z</dc:date>
    <item>
      <title>Create from value a valid iterable object in REST automation</title>
      <link>https://community.qlik.com/t5/Qlik-Automate/Create-from-value-a-valid-iterable-object-in-REST-automation/m-p/2043238#M1396</link>
      <description>&lt;P&gt;Hi People,&lt;/P&gt;
&lt;P&gt;I need to extract my data with automation because it has to be send to Snowflake. Then the data will be transformed in Qlik Compose.&lt;/P&gt;
&lt;P&gt;I'm stuck in a self created REST automation with nested data. I have multiple loops that retrieve the data. In the last loop I get a error message:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MartijnWanders_2-1677594094226.png" style="width: 800px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/101584iCD8D8F14FD2A0A53/image-dimensions/800x84?v=v2" width="800" height="84" role="button" title="MartijnWanders_2-1677594094226.png" alt="MartijnWanders_2-1677594094226.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The last loop is based on a value field. For the most records it contains a value and in the example FILEM-1, see below:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MartijnWanders_1-1677594050679.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/101582i779A2E4D2251BD91/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MartijnWanders_1-1677594050679.png" alt="MartijnWanders_1-1677594050679.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;But in attribute "attr_install_type" it will give again a nested value, see below:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MartijnWanders_0-1677594033543.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/101581i7A2CBB470A9CB7DE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MartijnWanders_0-1677594033543.png" alt="MartijnWanders_0-1677594033543.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I can imagen it can not iterate on this field but I can not find a solution. Is there something else which I can you to make the loop working?&lt;/P&gt;
&lt;P&gt;It's hard to give the full json file of this automation because my customer is very keen on security etc..&lt;/P&gt;
&lt;P&gt;I hope that someone had the same issue en solved it.&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;p.s: I tried to flatten the JSON but then the automation give other errors which I can not solve. But this is my plan B.&lt;/P&gt;
&lt;P&gt;Martijn Wanders&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 14:39:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Automate/Create-from-value-a-valid-iterable-object-in-REST-automation/m-p/2043238#M1396</guid>
      <dc:creator>MartijnWanders</dc:creator>
      <dc:date>2023-02-28T14:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: Create from value a valid iterable object in REST automation</title>
      <link>https://community.qlik.com/t5/Qlik-Automate/Create-from-value-a-valid-iterable-object-in-REST-automation/m-p/2043298#M1398</link>
      <description>&lt;P&gt;I would go for the flatten solution. Another option is to load the data in a qs app and store it as csv and then use QAA to only upload the data to snowflake. You could also do an sql insert directly in qs script if you do not need any other features of QAA&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 16:09:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Automate/Create-from-value-a-valid-iterable-object-in-REST-automation/m-p/2043298#M1398</guid>
      <dc:creator>blaise</dc:creator>
      <dc:date>2023-02-28T16:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: Create from value a valid iterable object in REST automation</title>
      <link>https://community.qlik.com/t5/Qlik-Automate/Create-from-value-a-valid-iterable-object-in-REST-automation/m-p/2043356#M1399</link>
      <description>&lt;P&gt;Hi Blaise,&lt;/P&gt;
&lt;P&gt;Thank you for your quick reply! I rather want to have to extract in a Qlik app.&lt;/P&gt;
&lt;P&gt;Is it possible to make an insert statement in Snowflake table with Qlik script? Do you have an example? I never saw this and sounds very intresting.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 18:21:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Automate/Create-from-value-a-valid-iterable-object-in-REST-automation/m-p/2043356#M1399</guid>
      <dc:creator>MartijnWanders</dc:creator>
      <dc:date>2023-02-28T18:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: Create from value a valid iterable object in REST automation</title>
      <link>https://community.qlik.com/t5/Qlik-Automate/Create-from-value-a-valid-iterable-object-in-REST-automation/m-p/2043398#M1400</link>
      <description>&lt;P&gt;there is a checkbox to mark when you set up the connection (something like allow non-select queries) and you have to add a specific keyword at the end of the statement but apart from that its a simple insert into &amp;lt;table&amp;gt; &amp;lt;list of columns&amp;gt; (values). A very simple example with only one column and one row to insert;&lt;/P&gt;
&lt;PRE&gt;SQL INSERT INTO QLIK.TEST.TEST (C1) &lt;BR /&gt;VALUES ('STRING ONE')&lt;BR /&gt;!EXECUTE_NON_SELECT_QUERY;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 20:08:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Automate/Create-from-value-a-valid-iterable-object-in-REST-automation/m-p/2043398#M1400</guid>
      <dc:creator>blaise</dc:creator>
      <dc:date>2023-02-28T20:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: Create from value a valid iterable object in REST automation</title>
      <link>https://community.qlik.com/t5/Qlik-Automate/Create-from-value-a-valid-iterable-object-in-REST-automation/m-p/2043431#M1401</link>
      <description>&lt;P&gt;Hi Blaise,&lt;/P&gt;
&lt;P&gt;Thanks for this information. I tried it and work perfectly. Now I insert it with one row at once. I'm going to investigate to create a bulk load.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 21:26:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Automate/Create-from-value-a-valid-iterable-object-in-REST-automation/m-p/2043431#M1401</guid>
      <dc:creator>MartijnWanders</dc:creator>
      <dc:date>2023-02-28T21:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: Create from value a valid iterable object in REST automation</title>
      <link>https://community.qlik.com/t5/Qlik-Automate/Create-from-value-a-valid-iterable-object-in-REST-automation/m-p/2043569#M1405</link>
      <description>&lt;P&gt;I usually loop the insert statement with 100 rows for every iteration - works fine at takes way less time than doing it row by row. MSSQL though, snowflake might have other restrictions etc.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 07:12:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Automate/Create-from-value-a-valid-iterable-object-in-REST-automation/m-p/2043569#M1405</guid>
      <dc:creator>blaise</dc:creator>
      <dc:date>2023-03-01T07:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: Create from value a valid iterable object in REST automation</title>
      <link>https://community.qlik.com/t5/Qlik-Automate/Create-from-value-a-valid-iterable-object-in-REST-automation/m-p/2043756#M1410</link>
      <description>&lt;P&gt;Hi Blaise,&lt;/P&gt;
&lt;P&gt;Per 100 rows is working with Snowflake. But I have to create a lot of variables to manage this. I'm going to make a new thread for help with Flatten the file and Automation.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 12:06:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Automate/Create-from-value-a-valid-iterable-object-in-REST-automation/m-p/2043756#M1410</guid>
      <dc:creator>MartijnWanders</dc:creator>
      <dc:date>2023-03-01T12:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: Create from value a valid iterable object in REST automation</title>
      <link>https://community.qlik.com/t5/Qlik-Automate/Create-from-value-a-valid-iterable-object-in-REST-automation/m-p/2043894#M1413</link>
      <description>&lt;P&gt;this is how i do it (not that many variables :))&lt;/P&gt;
&lt;PRE&gt;LIB CONNECT TO 'Snowflake';&lt;BR /&gt;&lt;BR /&gt;SQL TRUNCATE TABLE QLIK.TEST.TEST !EXECUTE_NON_SELECT_QUERY;&lt;BR /&gt;&lt;BR /&gt;TmpUpload:&lt;BR /&gt;LOAD&lt;BR /&gt;num(class(rowNo()-1,100)) as TmpSqlRowClass,&lt;BR /&gt;rowNo() as TmpSqlRowNo,&lt;BR /&gt;'('&lt;BR /&gt;&amp;amp; if(len(Column1) &amp;lt; 1,'NULL',chr(39) &amp;amp; text(timestamp(Column1,'YYYY-MM-DD hh:mm:ss')) &amp;amp; chr(39) ) &amp;amp; chr(44)&lt;BR /&gt;&amp;amp; if(len(Column2) &amp;lt; 1,'NULL',chr(39) &amp;amp; text(Column2) &amp;amp; chr(39) ) &amp;amp; chr(44) &lt;BR /&gt;&amp;amp; if(len(Column3) &amp;lt; 1,'NULL',chr(39) &amp;amp; text(Column3) &amp;amp; chr(39) ) &amp;amp; chr(44)&lt;BR /&gt;&amp;amp; if(len(Column6) &amp;lt; 1,'NULL', text(num(Column6,'#','.',' ')) ) &amp;amp; chr(44) &lt;BR /&gt;&amp;amp; if(len(Column7) &amp;lt; 1,'NULL',chr(39) &amp;amp; text(Column7) &amp;amp; chr(39) )&lt;BR /&gt;&amp;amp; ')' as TmpSqlInsertString&lt;BR /&gt;FROM &lt;BR /&gt;[lib://Data/SnowflakeUpload.qvd]&lt;BR /&gt;(qvd)&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;Upload:&lt;BR /&gt;LOAD&lt;BR /&gt;TmpSqlRowClass as SqlRowClass,&lt;BR /&gt;concat(distinct TmpSqlInsertString,',') as SqlInsertString&lt;BR /&gt;RESIDENT&lt;BR /&gt;TmpUpload&lt;BR /&gt;Group By&lt;BR /&gt;TmpSqlRowClass&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;Drop Table TmpUpload;&lt;BR /&gt;&lt;BR /&gt;SET vSqlInsertString = "";&lt;BR /&gt;&lt;BR /&gt;For i = 0 to NoOfRows('Upload') - 1&lt;BR /&gt;Let vSqlInsertString = peek('SqlInsertString',$(i),'Upload');&lt;BR /&gt;&lt;BR /&gt;SQL INSERT INTO QLIK.TEST.TEST&lt;BR /&gt;(&lt;BR /&gt;Column1&lt;BR /&gt;,Column2&lt;BR /&gt;,Column3&lt;BR /&gt;,Column4&lt;BR /&gt;,Column5&lt;BR /&gt;,Column6&lt;BR /&gt;,Column7&lt;BR /&gt;)&lt;BR /&gt;VALUES&lt;BR /&gt;$(vSqlInsertString)&lt;BR /&gt;!EXECUTE_NON_SELECT_QUERY&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;Drop Table __skip_loading;&lt;BR /&gt;&lt;BR /&gt;Next;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 14:28:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Automate/Create-from-value-a-valid-iterable-object-in-REST-automation/m-p/2043894#M1413</guid>
      <dc:creator>blaise</dc:creator>
      <dc:date>2023-03-01T14:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: Create from value a valid iterable object in REST automation</title>
      <link>https://community.qlik.com/t5/Qlik-Automate/Create-from-value-a-valid-iterable-object-in-REST-automation/m-p/2044259#M1418</link>
      <description>&lt;P&gt;Hi Blaise,&lt;/P&gt;
&lt;P&gt;Your script is so much better than what I had. I implemented and it works fine.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for sharing!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2023 06:54:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Automate/Create-from-value-a-valid-iterable-object-in-REST-automation/m-p/2044259#M1418</guid>
      <dc:creator>MartijnWanders</dc:creator>
      <dc:date>2023-03-02T06:54:55Z</dc:date>
    </item>
  </channel>
</rss>

