<?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: How to pass data between actions in Splunk SOAR</title>
    <link>https://community.splunk.com/t5/Splunk-SOAR/How-to-pass-data-between-actions/m-p/605987#M897</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/247481"&gt;@GeorgeOrwell&lt;/a&gt;&amp;nbsp;in either custom code elements (code block/custom function) you can set up to 10 outputs.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you set an output on a Code Block you will see that it will be added to the code of the block:&lt;/P&gt;&lt;P&gt;&amp;lt;function_name&amp;gt;__&amp;lt;output_name&amp;gt; = None&lt;/P&gt;&lt;P&gt;In the code you simply need to build what you want to pass out, assign it to the above variable and then you should be able to select/use the output downstream in the decision. Be aware though that decisions have limited capability when it comes to list items in that it only really works with `in` and `not in` operators.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;If using a new custom function then simply map the list to one of the outputs configured in the settings and then make sure its all nested in the `outputs` variable at the end of the function and you should be able to use it in the decision.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 18 Jul 2022 12:41:44 GMT</pubDate>
    <dc:creator>phanTom</dc:creator>
    <dc:date>2022-07-18T12:41:44Z</dc:date>
    <item>
      <title>How to pass data between actions</title>
      <link>https://community.splunk.com/t5/Splunk-SOAR/How-to-pass-data-between-actions/m-p/605981#M896</link>
      <description>&lt;P&gt;I have two actions linked together.&lt;BR /&gt;The first one is a block with custom code where I want to list all of the files inside directory using&amp;nbsp; `os.listdirs()`&amp;nbsp;&lt;BR /&gt;The second one is decision block.&amp;nbsp;&lt;BR /&gt;I would like to be able to pass the result of the first block into the second.&amp;nbsp;&lt;BR /&gt;How can I go about it?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2022 11:58:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-SOAR/How-to-pass-data-between-actions/m-p/605981#M896</guid>
      <dc:creator>GeorgeOrwell</dc:creator>
      <dc:date>2022-07-18T11:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass data between actions</title>
      <link>https://community.splunk.com/t5/Splunk-SOAR/How-to-pass-data-between-actions/m-p/605987#M897</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/247481"&gt;@GeorgeOrwell&lt;/a&gt;&amp;nbsp;in either custom code elements (code block/custom function) you can set up to 10 outputs.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you set an output on a Code Block you will see that it will be added to the code of the block:&lt;/P&gt;&lt;P&gt;&amp;lt;function_name&amp;gt;__&amp;lt;output_name&amp;gt; = None&lt;/P&gt;&lt;P&gt;In the code you simply need to build what you want to pass out, assign it to the above variable and then you should be able to select/use the output downstream in the decision. Be aware though that decisions have limited capability when it comes to list items in that it only really works with `in` and `not in` operators.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;If using a new custom function then simply map the list to one of the outputs configured in the settings and then make sure its all nested in the `outputs` variable at the end of the function and you should be able to use it in the decision.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2022 12:41:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-SOAR/How-to-pass-data-between-actions/m-p/605987#M897</guid>
      <dc:creator>phanTom</dc:creator>
      <dc:date>2022-07-18T12:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass data between actions</title>
      <link>https://community.splunk.com/t5/Splunk-SOAR/How-to-pass-data-between-actions/m-p/605994#M898</link>
      <description>&lt;P&gt;What if I am not using&amp;nbsp;&lt;SPAN&gt;Code Block nor Custom Function, but instead I have "Add note" action which I reworked completely?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2022 13:20:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-SOAR/How-to-pass-data-between-actions/m-p/605994#M898</guid>
      <dc:creator>GeorgeOrwell</dc:creator>
      <dc:date>2022-07-18T13:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass data between actions</title>
      <link>https://community.splunk.com/t5/Splunk-SOAR/How-to-pass-data-between-actions/m-p/605995#M899</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/247481"&gt;@GeorgeOrwell&lt;/a&gt;&amp;nbsp;that's so v3.5&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Code blocks (legacy custom functions) were introduced so we didn't have to "butcher" existing blocks &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; This was the bane of my life as a PS-er until they gave us code blocks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would move your code/capability to the Code Block at a minimum otherwise you will need to use the old method of saving and retrieving data, which is clunky at best, using "save_object/get_object":&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/SOARonprem/5.3.2/PlaybookAPI/DataManagementAPI#save_object" target="_blank"&gt;&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/SOARonprem/5.3.2/PlaybookAPI/DataManagementAPI#save_object" target="_blank"&gt;https://docs.splunk.com/Documentation/SOARonprem/5.3.2/PlaybookAPI/DataManagementAPI#save_object&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2022 13:38:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-SOAR/How-to-pass-data-between-actions/m-p/605995#M899</guid>
      <dc:creator>phanTom</dc:creator>
      <dc:date>2022-07-18T13:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass data between actions</title>
      <link>https://community.splunk.com/t5/Splunk-SOAR/How-to-pass-data-between-actions/m-p/606131#M901</link>
      <description>&lt;P&gt;What about `phantom.save_run_data()`? Can we later access it by key from decision block without modifying it?&lt;BR /&gt;&lt;BR /&gt;Say we have&amp;nbsp;&lt;BR /&gt;phantom.save_run_data(key='add_note_13:temp_var', value=json.dumps("Hello"))&lt;BR /&gt;&lt;BR /&gt;Can we access "add_note_13:temp_var" in decision block?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 10:46:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-SOAR/How-to-pass-data-between-actions/m-p/606131#M901</guid>
      <dc:creator>GeorgeOrwell</dc:creator>
      <dc:date>2022-07-19T10:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass data between actions</title>
      <link>https://community.splunk.com/t5/Splunk-SOAR/How-to-pass-data-between-actions/m-p/606132#M902</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/247481"&gt;@GeorgeOrwell&lt;/a&gt;&amp;nbsp;no as it doesn't work like that and this would be a lot of custom code that would break the blocks (except code blocks &amp;amp; custom functions).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;A code block or custom function is by far the best solution to your issue.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Best practise would be to build an app with a `list directories` action as this is scalable and extendable and you would then be able to use the outputted datapath in a decision with no issues at all.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 10:51:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-SOAR/How-to-pass-data-between-actions/m-p/606132#M902</guid>
      <dc:creator>phanTom</dc:creator>
      <dc:date>2022-07-19T10:51:36Z</dc:date>
    </item>
  </channel>
</rss>

