<?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: Working with lists in Cortex XSOAR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/working-with-lists/m-p/569565#M2908</link>
    <description>&lt;P&gt;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/271949"&gt;@Bar_Magnezi&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;The command&amp;nbsp;&lt;STRONG&gt;!RemoveFromList&lt;/STRONG&gt; only removes single elements from a comma-separated list.&amp;nbsp;&lt;BR /&gt;To remove the items from the list based on a user selection, you can do it following this simple process:&lt;/P&gt;
&lt;P&gt;1. Survey the user with selection (&lt;SPAN&gt;"TEST"/"BBLTD"/"BBMA"). This can be a Data Collection task and it will record the answer in&amp;nbsp;&lt;STRONG&gt;&amp;lt;DC Name&amp;gt;.Answers.0&lt;/STRONG&gt;.&lt;BR /&gt;2. Load the content of your list into context data, splitting it by line break as delimiter. This can be a &lt;STRONG&gt;Set&lt;/STRONG&gt; command with &lt;STRONG&gt;Split&amp;amp;Trim&lt;/STRONG&gt; transformer.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;3. From the list in context data, select the list item that contains the answer from the survey. For example, if the user selected&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;BBLTD&lt;/EM&gt;&lt;/STRONG&gt;, this task will retrieve &lt;STRONG&gt;&lt;EM&gt;"BBLTD,Mon Oct 30 2023,10.0.0.14/\DASD.com/\sdasdas.co.il,user1,"&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;. &lt;/EM&gt;You can do this by using a filter.&amp;nbsp;&lt;BR /&gt;4. Compare this list item with the full list by using the automation &lt;STRONG&gt;CompareLists&lt;/STRONG&gt;. This automation takes in two arguments, left and right and it will output the unique elements on each side. From this output, we're only interested in getting all the elements in the list, except the list item that the user selected.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;5. We overwrite the list with the command &lt;STRONG&gt;setList&lt;/STRONG&gt;.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I've attached here a simple playbook that does this process as a proof of concept. The prerequisite to run this is to have a list called&amp;nbsp;&lt;STRONG&gt;TestLiveCommunityQuestion&lt;/STRONG&gt; with this content:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;TEST,Mon Oct 30 2023,Teva.com/\teva.co.il/\test@gmail.com,user1,&lt;BR /&gt;BBLTD,Mon Oct 30 2023,10.0.0.14/\DASD.com/\sdasdas.co.il,user1,&lt;BR /&gt;BBMA,Mon Oct 30 2023,10.0.0.14/\DASD.com/\sdasdas.co.il,user2&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;To use this playbook, unzip the yml file and upload it to your list of playbooks.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Dec 2023 23:33:41 GMT</pubDate>
    <dc:creator>AbelSantamarina</dc:creator>
    <dc:date>2023-12-12T23:33:41Z</dc:date>
    <item>
      <title>Working with lists</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/working-with-lists/m-p/563514#M2782</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;In the settings section i created a new list&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The list contains for example:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;TEST,Mon Oct 30 2023,Teva.com/\teva.co.il/\test@gmail.com,user1,&lt;BR /&gt;BBLTD,Mon Oct 30 2023,10.0.0.14/\DASD.com/\sdasdas.co.il,user1,&lt;BR /&gt;BBMA,Mon Oct 30 2023,10.0.0.14/\DASD.com/\sdasdas.co.il,user2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in a playbook a user can choose 1 of the 3 ("TEST"/"BBLTD"/"BBMA")&lt;BR /&gt;Then the whole line should be deleted , the command !RemoveFromList only removes the specific word...&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2023 11:59:58 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/working-with-lists/m-p/563514#M2782</guid>
      <dc:creator>Bar_Magnezi</dc:creator>
      <dc:date>2023-10-30T11:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: Working with lists</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/working-with-lists/m-p/569565#M2908</link>
      <description>&lt;P&gt;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/271949"&gt;@Bar_Magnezi&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;The command&amp;nbsp;&lt;STRONG&gt;!RemoveFromList&lt;/STRONG&gt; only removes single elements from a comma-separated list.&amp;nbsp;&lt;BR /&gt;To remove the items from the list based on a user selection, you can do it following this simple process:&lt;/P&gt;
&lt;P&gt;1. Survey the user with selection (&lt;SPAN&gt;"TEST"/"BBLTD"/"BBMA"). This can be a Data Collection task and it will record the answer in&amp;nbsp;&lt;STRONG&gt;&amp;lt;DC Name&amp;gt;.Answers.0&lt;/STRONG&gt;.&lt;BR /&gt;2. Load the content of your list into context data, splitting it by line break as delimiter. This can be a &lt;STRONG&gt;Set&lt;/STRONG&gt; command with &lt;STRONG&gt;Split&amp;amp;Trim&lt;/STRONG&gt; transformer.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;3. From the list in context data, select the list item that contains the answer from the survey. For example, if the user selected&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;BBLTD&lt;/EM&gt;&lt;/STRONG&gt;, this task will retrieve &lt;STRONG&gt;&lt;EM&gt;"BBLTD,Mon Oct 30 2023,10.0.0.14/\DASD.com/\sdasdas.co.il,user1,"&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;. &lt;/EM&gt;You can do this by using a filter.&amp;nbsp;&lt;BR /&gt;4. Compare this list item with the full list by using the automation &lt;STRONG&gt;CompareLists&lt;/STRONG&gt;. This automation takes in two arguments, left and right and it will output the unique elements on each side. From this output, we're only interested in getting all the elements in the list, except the list item that the user selected.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;5. We overwrite the list with the command &lt;STRONG&gt;setList&lt;/STRONG&gt;.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I've attached here a simple playbook that does this process as a proof of concept. The prerequisite to run this is to have a list called&amp;nbsp;&lt;STRONG&gt;TestLiveCommunityQuestion&lt;/STRONG&gt; with this content:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;TEST,Mon Oct 30 2023,Teva.com/\teva.co.il/\test@gmail.com,user1,&lt;BR /&gt;BBLTD,Mon Oct 30 2023,10.0.0.14/\DASD.com/\sdasdas.co.il,user1,&lt;BR /&gt;BBMA,Mon Oct 30 2023,10.0.0.14/\DASD.com/\sdasdas.co.il,user2&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;To use this playbook, unzip the yml file and upload it to your list of playbooks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 23:33:41 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/working-with-lists/m-p/569565#M2908</guid>
      <dc:creator>AbelSantamarina</dc:creator>
      <dc:date>2023-12-12T23:33:41Z</dc:date>
    </item>
  </channel>
</rss>

