<?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: Multiselect to pass a token in Static value in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-to-pass-a-token-in-Static-value/m-p/498700#M32645</link>
    <description>&lt;P&gt;@kamlesh_vaghela please test with dynamic results in multiselect.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; require([
     'underscore',
     'splunkjs/mvc',
     'splunkjs/mvc/simplexml/ready!'], function (_, mvc) {

 var multiselect = splunkjs.mvc.Components.getInstance("multiselectId");
 multiselect.on("change", function (value) {
     var defaulLabel="All Shops";
     if (value.length &amp;gt; 1 &amp;amp;&amp;amp; ~(value.indexOf(defaulLabel))) {
         if (value.indexOf(defaulLabel) == 0) {
             value.splice(value.indexOf(defaulLabel), 1);
             this.val(value);
             console.log("Final ",value);
         } else {
             this.val(defaulLabel);
         }
         this.render();
     }
 })
 });
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 03 Feb 2020 08:52:03 GMT</pubDate>
    <dc:creator>DataOrg</dc:creator>
    <dc:date>2020-02-03T08:52:03Z</dc:date>
    <item>
      <title>Multiselect to pass a token in Static value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-to-pass-a-token-in-Static-value/m-p/498694#M32639</link>
      <description>&lt;P&gt;I tried passing  token value in multiselect from another results but it was not picking the token value. is there any turnaround option for this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;choice value="$Token$"&amp;gt;All&amp;lt;/choice&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this where i have to pass the token value&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="multiselect" token="env" searchWhenChanged="true"&amp;gt;
    &amp;lt;label&amp;gt;Environment&amp;lt;/label&amp;gt;
     &amp;lt;search&amp;gt;    &amp;lt;query&amp;gt;dedup environment&amp;lt;/query&amp;gt;
    &amp;lt;/search&amp;gt;
         &amp;lt;choice value="$Token$"&amp;gt;All&amp;lt;/choice&amp;gt;
    &amp;lt;fieldForLabel&amp;gt;environment&amp;lt;/fieldForLabel&amp;gt;
    &amp;lt;fieldForValue&amp;gt;environment&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 31 Jan 2020 12:11:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-to-pass-a-token-in-Static-value/m-p/498694#M32639</guid>
      <dc:creator>DataOrg</dc:creator>
      <dc:date>2020-01-31T12:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: Multiselect to pass a token in Static value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-to-pass-a-token-in-Static-value/m-p/498695#M32640</link>
      <description>&lt;P&gt;@premranjithj &lt;/P&gt;

&lt;P&gt;You can use token in search and populate dropdown. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="multiselect" token="multiselect" id="multiselectId"&amp;gt;
  &amp;lt;label&amp;gt;Multi Select&amp;lt;/label&amp;gt;
  &amp;lt;delimiter&amp;gt; &amp;lt;/delimiter&amp;gt;
  &amp;lt;fieldForLabel&amp;gt;environment&amp;lt;/fieldForLabel&amp;gt;
  &amp;lt;fieldForValue&amp;gt;environment_value&amp;lt;/fieldForValue&amp;gt;
  &amp;lt;search&amp;gt;
    &amp;lt;query&amp;gt;YOUR_SEARCH | dedup environment | table environment | eval environment_value=environment, a=1
      | append  [| makeresults | eval environment="$value$",environment_value="All", a=0] | sort a | table environment environment_value&amp;lt;/query&amp;gt;
  &amp;lt;/search&amp;gt;
&amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 31 Jan 2020 12:26:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-to-pass-a-token-in-Static-value/m-p/498695#M32640</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2020-01-31T12:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: Multiselect to pass a token in Static value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-to-pass-a-token-in-Static-value/m-p/498696#M32641</link>
      <description>&lt;P&gt;@kamlesh_vaghela . I have JS to check All is selected other selection should be removed which is not working if its not a static value.&lt;BR /&gt;
i was using the similar approach only but its not working with JS&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 12:43:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-to-pass-a-token-in-Static-value/m-p/498696#M32641</guid>
      <dc:creator>DataOrg</dc:creator>
      <dc:date>2020-01-31T12:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: Multiselect to pass a token in Static value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-to-pass-a-token-in-Static-value/m-p/498697#M32642</link>
      <description>&lt;P&gt;@premranjithj&lt;/P&gt;

&lt;P&gt;You can make it dynamic by using search it self. You can assign your required values to &lt;CODE&gt;$Token$&lt;/CODE&gt; and use it in search. Can you share more information regarding &lt;CODE&gt;$Token$&lt;/CODE&gt; how you populate this token?&lt;/P&gt;</description>
      <pubDate>Sun, 02 Feb 2020 05:29:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-to-pass-a-token-in-Static-value/m-p/498697#M32642</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2020-02-02T05:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: Multiselect to pass a token in Static value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-to-pass-a-token-in-Static-value/m-p/498698#M32643</link>
      <description>&lt;P&gt;@kamlesh_vaghela  i dont have problem is with generating token values . I have JS which is not working if ALL values are generated from search instead of all shps&amp;lt;&amp;gt;&lt;/P&gt;

&lt;P&gt;I am using JS to check if "All values" are selected other options should be unselected which is not working&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 07:05:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-to-pass-a-token-in-Static-value/m-p/498698#M32643</guid>
      <dc:creator>DataOrg</dc:creator>
      <dc:date>2020-02-03T07:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: Multiselect to pass a token in Static value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-to-pass-a-token-in-Static-value/m-p/498699#M32644</link>
      <description>&lt;P&gt;@premranjithj&lt;BR /&gt;
Can you please share your full  JS?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 07:07:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-to-pass-a-token-in-Static-value/m-p/498699#M32644</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2020-02-03T07:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: Multiselect to pass a token in Static value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-to-pass-a-token-in-Static-value/m-p/498700#M32645</link>
      <description>&lt;P&gt;@kamlesh_vaghela please test with dynamic results in multiselect.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; require([
     'underscore',
     'splunkjs/mvc',
     'splunkjs/mvc/simplexml/ready!'], function (_, mvc) {

 var multiselect = splunkjs.mvc.Components.getInstance("multiselectId");
 multiselect.on("change", function (value) {
     var defaulLabel="All Shops";
     if (value.length &amp;gt; 1 &amp;amp;&amp;amp; ~(value.indexOf(defaulLabel))) {
         if (value.indexOf(defaulLabel) == 0) {
             value.splice(value.indexOf(defaulLabel), 1);
             this.val(value);
             console.log("Final ",value);
         } else {
             this.val(defaulLabel);
         }
         this.render();
     }
 })
 });
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Feb 2020 08:52:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-to-pass-a-token-in-Static-value/m-p/498700#M32645</guid>
      <dc:creator>DataOrg</dc:creator>
      <dc:date>2020-02-03T08:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: Multiselect to pass a token in Static value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-to-pass-a-token-in-Static-value/m-p/498701#M32646</link>
      <description>&lt;P&gt;@premranjithj&lt;/P&gt;

&lt;P&gt;here you need to change &lt;CODE&gt;defaulLabel&lt;/CODE&gt; variable value from &lt;CODE&gt;All Shops&lt;/CODE&gt; to &lt;CODE&gt;All values&lt;/CODE&gt;.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  var defaulLabel="All Shops";
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Feb 2020 09:38:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Multiselect-to-pass-a-token-in-Static-value/m-p/498701#M32646</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2020-02-03T09:38:19Z</dc:date>
    </item>
  </channel>
</rss>

