<?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 Python output to variable in Qlik Automate</title>
    <link>https://community.qlik.com/t5/Qlik-Automate/Python-output-to-variable/m-p/1891455#M366</link>
    <description>&lt;P&gt;I have a custom code block with python code that returns a python list of app id's.&lt;/P&gt;
&lt;P&gt;[item 1, item2, item3] python sees this as an list and will loop over this list in shell. In automations I've got a code block and after that a list-variable where the output is put in.&lt;/P&gt;
&lt;P&gt;What I find is that even tho the variable is a list the output is treated as 1 item instead of 3 therefore my call to get app information about 3 app's throws an error because it places all 3 appid's into 1 string instead of preforming the action 3 times.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to loop over the list of app id's to&amp;nbsp; get app information.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Feb 2022 10:45:05 GMT</pubDate>
    <dc:creator>MartW</dc:creator>
    <dc:date>2022-02-10T10:45:05Z</dc:date>
    <item>
      <title>Python output to variable</title>
      <link>https://community.qlik.com/t5/Qlik-Automate/Python-output-to-variable/m-p/1891455#M366</link>
      <description>&lt;P&gt;I have a custom code block with python code that returns a python list of app id's.&lt;/P&gt;
&lt;P&gt;[item 1, item2, item3] python sees this as an list and will loop over this list in shell. In automations I've got a code block and after that a list-variable where the output is put in.&lt;/P&gt;
&lt;P&gt;What I find is that even tho the variable is a list the output is treated as 1 item instead of 3 therefore my call to get app information about 3 app's throws an error because it places all 3 appid's into 1 string instead of preforming the action 3 times.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to loop over the list of app id's to&amp;nbsp; get app information.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 10:45:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Automate/Python-output-to-variable/m-p/1891455#M366</guid>
      <dc:creator>MartW</dc:creator>
      <dc:date>2022-02-10T10:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: Python output to variable</title>
      <link>https://community.qlik.com/t5/Qlik-Automate/Python-output-to-variable/m-p/1891581#M368</link>
      <description>&lt;P&gt;I figured it out. the list as an output in automations as mentioned above is [item 1, item2]&lt;/P&gt;
&lt;P&gt;this is from a native print statement in python then it doesn't work.&lt;/P&gt;
&lt;P&gt;if you add the code than it works&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;(don't forget to do import json)

print(json.dumps(list))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 15:34:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Automate/Python-output-to-variable/m-p/1891581#M368</guid>
      <dc:creator>MartW</dc:creator>
      <dc:date>2022-02-10T15:34:33Z</dc:date>
    </item>
  </channel>
</rss>

