<?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: Newbie question - how to write an array to a file in the context so I can send with O365 email integration in Cortex XSOAR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/newbie-question-how-to-write-an-array-to-a-file-in-the-context/m-p/589047#M3385</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/208028"&gt;@jfernandes1&lt;/a&gt;&amp;nbsp;I ended up writing a short Python automation - in your solution it joins the rows into a single row, but I wanted the host on a new line, so I can effectively export that as a file that others can load into a some tool to view, it has around 10,000 entries so not useful on one line.&lt;/P&gt;
&lt;P&gt;Appreciate the learning - thanks!&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jun 2024 06:04:29 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2024-06-07T06:04:29Z</dc:date>
    <item>
      <title>Newbie question - how to write an array to a file in the context so I can send with O365 email integration</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/newbie-question-how-to-write-an-array-to-a-file-in-the-context/m-p/588911#M3376</link>
      <description>&lt;P&gt;I have an array of hostnames, which I want to then turn into an attachment and then send by email using the O365 integration.&lt;/P&gt;
&lt;P&gt;If I put ${array} into the body, it will loop and send an email for each element of the array. If I do ArrayToCSV, it then just sends a comma separated line of host names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I really want to do is create a file with a header (hostname) and then a line for each host name in the array, which I can then use as an attachment Id in the O365 integration, and I'm struggling. Are there any automations that I can use to do this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2024 07:36:11 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/newbie-question-how-to-write-an-array-to-a-file-in-the-context/m-p/588911#M3376</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-06-06T07:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie question - how to write an array to a file in the context so I can send with O365 email integration</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/newbie-question-how-to-write-an-array-to-a-file-in-the-context/m-p/589046#M3384</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/1022065011"&gt;@bowesmana&lt;/a&gt;, you're going to have to split this into 2 steps. One to the make the file and the other to send it. Since you did not specify a format, I'll assume .txt should work.&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="Screenshot 2024-06-07 at 2.38.46 PM.png" style="width: 641px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/60252i525A075FB70AEA7B/image-dimensions/641x352?v=v2" width="641" height="352" role="button" title="Screenshot 2024-06-07 at 2.38.46 PM.png" alt="Screenshot 2024-06-07 at 2.38.46 PM.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. You can use the &lt;STRONG&gt;FileCreateAndUpload&lt;/STRONG&gt; function. This will return a file object to the warroom. You can then use this &lt;STRONG&gt;entryID&lt;/STRONG&gt; to attach to the email.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. List created in content and references in "Get" section.&lt;/P&gt;
&lt;P&gt;3. I've used &lt;STRONG&gt;ArrayToCSV&lt;/STRONG&gt;, but you can use anything that merges your content. &lt;STRONG&gt;Join&lt;/STRONG&gt;, &lt;STRONG&gt;append&lt;/STRONG&gt;, &lt;STRONG&gt;stringfy&lt;/STRONG&gt;, etc.&lt;/P&gt;
&lt;P&gt;4. Since you wanted a title.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;5. Command output, file output below.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-06-07 at 2.42.57 PM.png" style="width: 383px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/60253i9F59931D5ECC1F92/image-dimensions/383x64?v=v2" width="383" height="64" role="button" title="Screenshot 2024-06-07 at 2.42.57 PM.png" alt="Screenshot 2024-06-07 at 2.42.57 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2024 04:46:58 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/newbie-question-how-to-write-an-array-to-a-file-in-the-context/m-p/589046#M3384</guid>
      <dc:creator>jfernandes1</dc:creator>
      <dc:date>2024-06-07T04:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie question - how to write an array to a file in the context so I can send with O365 email integration</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/newbie-question-how-to-write-an-array-to-a-file-in-the-context/m-p/589047#M3385</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/208028"&gt;@jfernandes1&lt;/a&gt;&amp;nbsp;I ended up writing a short Python automation - in your solution it joins the rows into a single row, but I wanted the host on a new line, so I can effectively export that as a file that others can load into a some tool to view, it has around 10,000 entries so not useful on one line.&lt;/P&gt;
&lt;P&gt;Appreciate the learning - thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2024 06:04:29 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/newbie-question-how-to-write-an-array-to-a-file-in-the-context/m-p/589047#M3385</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-06-07T06:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie question - how to write an array to a file in the context so I can send with O365 email integration</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/newbie-question-how-to-write-an-array-to-a-file-in-the-context/m-p/589209#M3387</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/1022065011"&gt;@bowesmana&lt;/a&gt;, in my previous example, you can swap the &lt;STRONG&gt;ArrayToCSV&lt;/STRONG&gt;&amp;nbsp;for the &lt;STRONG&gt;Join&lt;/STRONG&gt; transformer. In the &lt;STRONG&gt;Join&lt;/STRONG&gt; set the delimiter to the enter or return key. This will add each entry on a new line.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-06-11 at 12.06.15 PM.png" style="width: 527px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/60281iF580F0BC006B0C46/image-dimensions/527x159?v=v2" width="527" height="159" role="button" title="Screenshot 2024-06-11 at 12.06.15 PM.png" alt="Screenshot 2024-06-11 at 12.06.15 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 02:08:22 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/newbie-question-how-to-write-an-array-to-a-file-in-the-context/m-p/589209#M3387</guid>
      <dc:creator>jfernandes1</dc:creator>
      <dc:date>2024-06-11T02:08:22Z</dc:date>
    </item>
  </channel>
</rss>

