<?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: Command &amp;quot;setList&amp;quot; issue introducing variables from context in Cortex XSOAR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/command-quot-setlist-quot-issue-introducing-variables-from/m-p/523247#M1491</link>
    <description>&lt;P&gt;Good morning Fernandes and thanks for your answer.&lt;/P&gt;
&lt;P&gt;The purpose using "SetList" is to overwritre the data. First, we download all json to context, we manipulate it, then "SetList" commmand updates using the context the json, overwriting. However, sometimes the value of the key-value pair can be an array, so this causes a malfunction.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;Normally it will be: {"${key}": "${value}"}&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;But with an array should be: {"${key}": ${value_array}}, with&amp;nbsp; no "&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;So the point is how to use the same json value format for both cases.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Dec 2022 08:28:33 GMT</pubDate>
    <dc:creator>Josep</dc:creator>
    <dc:date>2022-12-05T08:28:33Z</dc:date>
    <item>
      <title>Command "setList" issue introducing variables from context</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/command-quot-setlist-quot-issue-introducing-variables-from/m-p/522998#M1481</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;We're using command "demisto.executeCommand("setList",{"listName":listName,"listData":listContent})" in order to introduce data in a json list. Where the "listName" is a json list name and "listContent" is data extracted from the context.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;The issue:&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;The values introduced in "listContent" are like this example, "IPs" is a context variable that could be a single value or an array. And that's the main problem. If it's a single variable, it will be introduced like: "${Variable}":&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;{"value":{"IPs": "${Variable}"}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;However, if it's introduced as an array, the " is no needed, so it will be: ${Variable}. With no comas:&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;{"value":{"IPs": ${Variable}}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So it's not possible to create the same command or task for both cases.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 09:58:26 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/command-quot-setlist-quot-issue-introducing-variables-from/m-p/522998#M1481</guid>
      <dc:creator>Josep</dc:creator>
      <dc:date>2022-12-01T09:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: Command "setList" issue introducing variables from context</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/command-quot-setlist-quot-issue-introducing-variables-from/m-p/523236#M1490</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/226640"&gt;@Josep&lt;/a&gt;, The &lt;CODE&gt;setList&lt;/CODE&gt; automation is designed to overwrite the data inside the list. Could you try &lt;CODE&gt;addToList&lt;/CODE&gt; automation? It should work like shown in the screenshot.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-12-05 at 3.18.00 pm.png" style="width: 475px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/45893i528C212B7213973B/image-dimensions/475x399/is-moderation-mode/true?v=v2" width="475" height="399" role="button" title="Screen Shot 2022-12-05 at 3.18.00 pm.png" alt="Screen Shot 2022-12-05 at 3.18.00 pm.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 04:24:12 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/command-quot-setlist-quot-issue-introducing-variables-from/m-p/523236#M1490</guid>
      <dc:creator>jfernandes1</dc:creator>
      <dc:date>2022-12-05T04:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Command "setList" issue introducing variables from context</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/command-quot-setlist-quot-issue-introducing-variables-from/m-p/523247#M1491</link>
      <description>&lt;P&gt;Good morning Fernandes and thanks for your answer.&lt;/P&gt;
&lt;P&gt;The purpose using "SetList" is to overwritre the data. First, we download all json to context, we manipulate it, then "SetList" commmand updates using the context the json, overwriting. However, sometimes the value of the key-value pair can be an array, so this causes a malfunction.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;Normally it will be: {"${key}": "${value}"}&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;But with an array should be: {"${key}": ${value_array}}, with&amp;nbsp; no "&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;So the point is how to use the same json value format for both cases.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 08:28:33 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/command-quot-setlist-quot-issue-introducing-variables-from/m-p/523247#M1491</guid>
      <dc:creator>Josep</dc:creator>
      <dc:date>2022-12-05T08:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: Command "setList" issue introducing variables from context</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/command-quot-setlist-quot-issue-introducing-variables-from/m-p/523570#M1509</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/226640"&gt;@Josep&lt;/a&gt;, the only option would be to merge\join the data before calling the setList command. You could try using the "Join" transformer. It will work with string and list inputs.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2022 22:25:33 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/command-quot-setlist-quot-issue-introducing-variables-from/m-p/523570#M1509</guid>
      <dc:creator>jfernandes1</dc:creator>
      <dc:date>2022-12-07T22:25:33Z</dc:date>
    </item>
    <item>
      <title>Re: Command "setList" issue introducing variables from context</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/command-quot-setlist-quot-issue-introducing-variables-from/m-p/523686#M1515</link>
      <description>&lt;P&gt;Thanks Fernandes, I like how it sounds. Join first the list, so it won't be treated as an array.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2022 07:20:07 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/command-quot-setlist-quot-issue-introducing-variables-from/m-p/523686#M1515</guid>
      <dc:creator>Josep</dc:creator>
      <dc:date>2022-12-09T07:20:07Z</dc:date>
    </item>
  </channel>
</rss>

