<?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: setting multiple values in subkeys in Cortex XSOAR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/setting-multiple-values-in-subkeys/m-p/486008#M829</link>
    <description>&lt;P&gt;One more thing to keep in mind is the size of the CSV file. Adding a lot of data to context might affect incident load times and also create large indexes. The script solution takes a file as input and outputs another. No indexing is performed on a file's contents.&lt;/P&gt;</description>
    <pubDate>Tue, 10 May 2022 06:16:05 GMT</pubDate>
    <dc:creator>jfernandes1</dc:creator>
    <dc:date>2022-05-10T06:16:05Z</dc:date>
    <item>
      <title>setting multiple values in subkeys</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/setting-multiple-values-in-subkeys/m-p/485603#M821</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a seemingly simple task which i can't figure out how to handle. I want to import a csv file in the context, having column names as the subkeys. And then I want to get rid off some excessive subkeys/columns.&lt;/P&gt;&lt;P&gt;My steps are:&lt;/P&gt;&lt;P&gt;1. upload a file from file share using smb-download - &lt;STRONG&gt;SUCCESS&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;2. Import file in the context keys using ParseCSV automation - &lt;STRONG&gt;SUCCESS&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;3. Set a new key to only store selected subkeys - &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;FAIL&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;for the last, i'm using:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;!SetMultipleValues parent=testKey keys="Name,Surname" values="${ParseCSV.ParsedCSV.Name},${ParseCSV.ParsedCSV.Surname}"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it seems that &lt;STRONG&gt;SetMultipleValues&lt;/STRONG&gt; does not recognize that there is more than one value on the same subkey (i.e. &lt;STRONG&gt;ParseCSV.ParsedCSV.[0].Name,&amp;nbsp;ParseCSV.ParsedCSV.[1].Name, ParseCSV.ParsedCSV.[2].Name etc&lt;/STRONG&gt;) and is not running on all subkeys. What am i missing? Is there another easy way to take selected subkeys and store it on the separate subkeys?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using XSOAR 6.6 for this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Antanas&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 May 2022 11:49:22 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/setting-multiple-values-in-subkeys/m-p/485603#M821</guid>
      <dc:creator>Antanas</dc:creator>
      <dc:date>2022-05-08T11:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: setting multiple values in subkeys</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/setting-multiple-values-in-subkeys/m-p/485998#M826</link>
      <description>&lt;P&gt;Hi Antanas,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You will need to create a custom automation for this. The automation will have to loop the array and dict to remove the columns. I'm attaching some code I had written that does something similar. I had to process a CSV file and save specific columns.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;## Script to strip excess columns and only keep columns identified in the columnsToKeep field
# columnsToKeep - If no columns are matched a blank file will be created

# Arguments to the script
fileID = demisto.args()['fileEntryID']
fileName = demisto.args()['FileName']
columnsToKeep = demisto.args()['columnsToKeep']

# Output array
newData = []

# Convert file input into array of dict
data = demisto.executeCommand('ParseCSV', { 'entryID' : fileID })[0]['Contents']

# Loop through items and copy matched columns
for item in data:
  temp = {}
  for key in item:
    if key in columnsToKeep:
        temp[key] = item[key]
  newData.append(temp)

# Output data to csv file
demisto.results(demisto.executeCommand('ExportToCSV', { 'fileName' : 'stripped_' + str(fileName) + '.csv', 'csvArray' : newData }))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 04:50:39 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/setting-multiple-values-in-subkeys/m-p/485998#M826</guid>
      <dc:creator>jfernandes1</dc:creator>
      <dc:date>2022-05-10T04:50:39Z</dc:date>
    </item>
    <item>
      <title>Re: setting multiple values in subkeys</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/setting-multiple-values-in-subkeys/m-p/486007#M828</link>
      <description>&lt;P&gt;Thanks!&amp;nbsp; I definitely will try it. I also finally found a workaround for this - i import the whole thing with with parseCSV, and then use a transformer &lt;STRONG&gt;GetFields&lt;/STRONG&gt; in SetAndHandeEmpty to save the selected keys. Then i can delete the the initial one. Of course, your&amp;nbsp; suggested solution is more optimal.&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 05:57:48 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/setting-multiple-values-in-subkeys/m-p/486007#M828</guid>
      <dc:creator>Antanas</dc:creator>
      <dc:date>2022-05-10T05:57:48Z</dc:date>
    </item>
    <item>
      <title>Re: setting multiple values in subkeys</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/setting-multiple-values-in-subkeys/m-p/486008#M829</link>
      <description>&lt;P&gt;One more thing to keep in mind is the size of the CSV file. Adding a lot of data to context might affect incident load times and also create large indexes. The script solution takes a file as input and outputs another. No indexing is performed on a file's contents.&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 06:16:05 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/setting-multiple-values-in-subkeys/m-p/486008#M829</guid>
      <dc:creator>jfernandes1</dc:creator>
      <dc:date>2022-05-10T06:16:05Z</dc:date>
    </item>
  </channel>
</rss>

