<?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 refresh multiselect options with Javascript (re-execute the mutliselect search) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-refresh-multiselect-options-with-Javascript-re-execute/m-p/709083#M239677</link>
    <description>&lt;P&gt;Thank you very much! You saved me a ton of time, I would never have thought to do it that way. This solution works great!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Jan 2025 14:29:09 GMT</pubDate>
    <dc:creator>Afterimage</dc:creator>
    <dc:date>2025-01-17T14:29:09Z</dc:date>
    <item>
      <title>How to refresh multiselect options with Javascript (re-execute the mutliselect search)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-refresh-multiselect-options-with-Javascript-re-execute/m-p/709026#M239667</link>
      <description>&lt;P&gt;We have a custom dashboard in Splunk that has a few filters, one of which is a multiselect. This dashboard allows users to perform CRUD operations with POA&amp;amp;Ms. The multiselect in question lists all POA&amp;amp;M statuses that have been previously created, filtering the results displayed in the table.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Afterimage_0-1737057985877.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/34161iE3068F68E198ACFA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Afterimage_0-1737057985877.png" alt="Afterimage_0-1737057985877.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The filter works fine for searching results for the table. The issue is that if someone creates a new POA&amp;amp;M with a status that hasn't been used yet, i.e. "Closed", the page must be refreshed for the multiselect to execute the search powering it and display "Closed" as an option. Is there a way to "refresh" the multiselect with Javascript after a new POA&amp;amp;M is created? The POA&amp;amp;M CRUD operations are performed with JS and Python btw. Here's the XML of the multiselect for reference:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Afterimage_1-1737058334128.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/34162i599B57CE5968BA9F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Afterimage_1-1737058334128.png" alt="Afterimage_1-1737058334128.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2025 20:16:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-refresh-multiselect-options-with-Javascript-re-execute/m-p/709026#M239667</guid>
      <dc:creator>Afterimage</dc:creator>
      <dc:date>2025-01-16T20:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to refresh multiselect options with Javascript (re-execute the mutliselect search)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-refresh-multiselect-options-with-Javascript-re-execute/m-p/709042#M239675</link>
      <description>&lt;P&gt;If you have JS that is creating the new POA&amp;amp;M, then you could set a token in the JS that the multiselect search uses, When the token changes value, the multiselect search will re-run.&lt;/P&gt;&lt;P&gt;The MS would have something like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup sp6_poams ``` $ms_trigger_token$ ```&lt;/LI-CODE&gt;&lt;P&gt;i.e. it just needs to be in comments in the SPL and in your JS would do something like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    var defTokens = mvc.Components.get('default');
    var subTokens = mvc.Components.get('submitted');

    var value = defTokens.get('ms_trigger_token') + 1;
    defTokens.set('ms_trigger_token', value);
    subTokens.set('ms_trigger_token', value);&lt;/LI-CODE&gt;&lt;P&gt;Untested, but it's easy enough to do directly in XML but with JS you just need to get and increment the current token value and set it back - not sure exactly which of the default and/or submitted token models needs updating, but doesn't hurt to do both.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2025 02:35:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-refresh-multiselect-options-with-Javascript-re-execute/m-p/709042#M239675</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2025-01-17T02:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to refresh multiselect options with Javascript (re-execute the mutliselect search)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-refresh-multiselect-options-with-Javascript-re-execute/m-p/709043#M239676</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/275646"&gt;@Afterimage&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;There is an option to force the dropdown to re-run the search every X seconds.&lt;/P&gt;&lt;P&gt;Go into the Edit view and add this to the search:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;refresh&amp;gt;30&amp;lt;/refresh&amp;gt;
&amp;lt;refreshType&amp;gt;delay&amp;lt;/refreshType&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;Like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="danspav_1-1737081235749.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/34164iDA99A350D125AF2C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="danspav_1-1737081235749.png" alt="danspav_1-1737081235749.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;That will make the lookup search re-run every 30 seconds, picking up any new values in the process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Spav&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2025 02:36:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-refresh-multiselect-options-with-Javascript-re-execute/m-p/709043#M239676</guid>
      <dc:creator>danspav</dc:creator>
      <dc:date>2025-01-17T02:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to refresh multiselect options with Javascript (re-execute the mutliselect search)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-refresh-multiselect-options-with-Javascript-re-execute/m-p/709083#M239677</link>
      <description>&lt;P&gt;Thank you very much! You saved me a ton of time, I would never have thought to do it that way. This solution works great!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2025 14:29:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-refresh-multiselect-options-with-Javascript-re-execute/m-p/709083#M239677</guid>
      <dc:creator>Afterimage</dc:creator>
      <dc:date>2025-01-17T14:29:09Z</dc:date>
    </item>
  </channel>
</rss>

