<?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 How to pass multiselect input values to a drilldown target? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265663#M16734</link>
    <description>&lt;P&gt;Everyone,&lt;/P&gt;

&lt;P&gt;Assume that I have the token of &lt;STRONG&gt;$ticket_id$&lt;/STRONG&gt; on Page 1. The input type for this token is &lt;STRONG&gt;Multiselect&lt;/STRONG&gt;. The multiselect search string is &lt;CODE&gt;ticket_id="value1" OR ticket_id="value2"...&lt;/CODE&gt;. The multiselect is working fine and loading the correct data for all the panels on Page 1, but when I have to drill down to another page; value1 and value2 are not getting passed. Instead, the multiselect search string is passing i.e &lt;CODE&gt;ticket_id="value1" OR ticket_id="value2"...&lt;/CODE&gt;. I understand that the multiselect string is replacing the token &lt;STRONG&gt;$ticket_id$&lt;/STRONG&gt;. &lt;/P&gt;

&lt;P&gt;Now, the drilldown target also has multiselect inputs. Is there a way to pass more than one value to the drilldown target? &lt;/P&gt;

&lt;P&gt;The code for passing the values is as attached below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;drilldown target="_blank"&amp;gt;
      &amp;lt;lnk&amp;gt;
        &amp;lt;![CDATA[ ticket_review?form.severity=$row.severity$&amp;amp;form.ticket_id=$ticket_id$&amp;amp;form.time.earliest=$time.earliest$&amp;amp;form.time.latest=$time.latest$ ]]&amp;gt;
      &amp;lt;/lnk&amp;gt;
    &amp;lt;/drilldown&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let me know.&lt;/P&gt;</description>
    <pubDate>Tue, 06 Dec 2016 12:09:06 GMT</pubDate>
    <dc:creator>aamirs291</dc:creator>
    <dc:date>2016-12-06T12:09:06Z</dc:date>
    <item>
      <title>How to pass multiselect input values to a drilldown target?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265663#M16734</link>
      <description>&lt;P&gt;Everyone,&lt;/P&gt;

&lt;P&gt;Assume that I have the token of &lt;STRONG&gt;$ticket_id$&lt;/STRONG&gt; on Page 1. The input type for this token is &lt;STRONG&gt;Multiselect&lt;/STRONG&gt;. The multiselect search string is &lt;CODE&gt;ticket_id="value1" OR ticket_id="value2"...&lt;/CODE&gt;. The multiselect is working fine and loading the correct data for all the panels on Page 1, but when I have to drill down to another page; value1 and value2 are not getting passed. Instead, the multiselect search string is passing i.e &lt;CODE&gt;ticket_id="value1" OR ticket_id="value2"...&lt;/CODE&gt;. I understand that the multiselect string is replacing the token &lt;STRONG&gt;$ticket_id$&lt;/STRONG&gt;. &lt;/P&gt;

&lt;P&gt;Now, the drilldown target also has multiselect inputs. Is there a way to pass more than one value to the drilldown target? &lt;/P&gt;

&lt;P&gt;The code for passing the values is as attached below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;drilldown target="_blank"&amp;gt;
      &amp;lt;lnk&amp;gt;
        &amp;lt;![CDATA[ ticket_review?form.severity=$row.severity$&amp;amp;form.ticket_id=$ticket_id$&amp;amp;form.time.earliest=$time.earliest$&amp;amp;form.time.latest=$time.latest$ ]]&amp;gt;
      &amp;lt;/lnk&amp;gt;
    &amp;lt;/drilldown&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let me know.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2016 12:09:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265663#M16734</guid>
      <dc:creator>aamirs291</dc:creator>
      <dc:date>2016-12-06T12:09:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiselect input values to a drilldown target?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265664#M16735</link>
      <description>&lt;P&gt;I've had the same problem. The target dashboard needs the token url-encoded like &lt;CODE&gt;form.ticket_id=value1&amp;amp;form.ticked_id=value2&lt;/CODE&gt; and so on. My solution was to re-build the url-encoded token value in js before doing the drilldown, see here for sample code (not tested):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require([
    "splunkjs/mvc",
    "splunkjs/mvc/utils",
    "splunkjs/mvc/simplexml/ready!"
],
function(mvc, utils) {
    var tokens = mvc.Components.get("default");
    var sourceMultiselect = splunkjs.mvc.Components.getInstance("multiselect");

    var clickEventGenerator = ... // where your click comes from, e.g. a button or your table
    clickEventGenerator.on("click", function(e) {
        e.preventDefault(); // Stop default drilldown behavior
        // Create token string from time tokens and multivalue inputs
        var tokenString = "";
        tokenString = "?form.time_tok.earliest=" + tokens.get("time_tok.earliest") + "&amp;amp;form.time_tok.latest=" + tokens.get("time_tok.latest"); // Use your other own static tokens here, e.g. severity
        tokenString += returnUrldValues(sourceMultiselect.val(), "form.targetMultiselectTokenName"); // Add dynamic (mutlivalue) tokens here

        // Handle click event regularly
        var url = "/en-GB/app/appName/targetDashboard" + tokenString;
        utils.redirect(url, false, "_blank");
    });

    // Returns concatenation of all entries in multiVals with prefixed targetTokenName
    function returnUrldValues (multiVals, targetTokenName) {
        var string = "";
        for (var i = 0; i &amp;lt; multiVals.length; i++) {
            string += "&amp;amp;" + targetTokenName + "=" + multiVals[i];
        }
        return string;
    }
});
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope that gets you started.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2016 10:35:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265664#M16735</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2016-12-08T10:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiselect input values to a drilldown target?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265665#M16736</link>
      <description>&lt;P&gt;Jeffland,&lt;BR /&gt;
I will be accepting this answer since it seems to be the only good solution to the many multiselect questions being asked on this forum.&lt;BR /&gt;
I am not versed in .js so I don't know where I should be adding this code ? Should I add this to an existing .js file or should I modify the code ,save it and then place the file in the C:\Program Files\Splunk\share\splunk\search_mrsparkle\exposed\js\splunkjs\mvc directory ? &lt;BR /&gt;
Let me know. Thank you. &lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2016 17:03:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265665#M16736</guid>
      <dc:creator>aamirs291</dc:creator>
      <dc:date>2016-12-08T17:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiselect input values to a drilldown target?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265666#M16737</link>
      <description>&lt;P&gt;If you don't yet use custom js on your dashboard, you edit your Simple XML from&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Title&amp;lt;/label&amp;gt;
  &amp;lt;fieldset ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form script="myCustomJsFile.js"&amp;gt;
  &amp;lt;label&amp;gt;Title&amp;lt;/label&amp;gt;
  &amp;lt;fieldset ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and place myCustomJsFile.js in C:\Program Files\Splunk\etc\apps&amp;amp;lt;yourApp&amp;gt;\appserver\static.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2016 08:23:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265666#M16737</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2016-12-09T08:23:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiselect input values to a drilldown target?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265667#M16738</link>
      <description>&lt;P&gt;Ok so I did as you mentioned and the default drilldown is still working it isn't getting prevented. The old URL is still populating. &lt;/P&gt;

&lt;P&gt;I have done the following changes. Are these correct ? I have marked the changes I did in bold. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require([
     "splunkjs/mvc",
     "splunkjs/mvc/utils",
     "splunkjs/mvc/simplexml/ready!"
 ],
 function(mvc, utils) {
     var tokens = mvc.Components.get("default");
     var sourceMultiselect = splunkjs.mvc.Components.getInstance("multiselect");

 var clickEventGenerator = **table** // where your click comes from, e.g. a button or your table
 clickEventGenerator.on("click", function(e) {
     e.preventDefault(); // Stop default drilldown behavior
     // Create token string from time tokens and multivalue inputs
     var tokenString = "";
     tokenString = "&amp;amp;form**.time.earliest**=" + tokens.get("**time.earliest**") + "&amp;amp;form.**time.latest**=" + tokens.get("**time.latest**"); // Use your other own static tokens here, e.g. severity
     **tokenString = "?form.severity=" + tokens.get("row.severity");**
     tokenString += returnUrldValues(sourceMultiselect.val(), "form.**ticket_id**"); // Add dynamic (mutlivalue) tokens here

     // Handle click event regularly
     var url = "**http://localhost:8001**/en-US/app/**ticket_analysis/ticket_review**" + tokenString;
     utils.redirect(url, false, "_blank");
 });

 // Returns concatenation of all entries in multiVals with prefixed targetTokenName

 function returnUrldValues (multiVals, targetTokenName) {
     var string = "";
     for (var i = 0; i &amp;lt; multiVals.length; i++) {
         string += "&amp;amp;" + **ticket_id**+ "=" + multiVals[i];
     }
     return string;
     }
 });
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;-- Also is for(var .. correct ? &lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2016 10:23:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265667#M16738</guid>
      <dc:creator>aamirs291</dc:creator>
      <dc:date>2016-12-09T10:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiselect input values to a drilldown target?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265668#M16739</link>
      <description>&lt;P&gt;What is &lt;CODE&gt;table&lt;/CODE&gt; in the line you're assigning it to the variable clickEventGenerator? It should be something like &lt;CODE&gt;mvc.Components.get("tableId")&lt;/CODE&gt;, where tableId is the id you've given your table in Simple XML. Also, you're overwriting tokenString in the fourth and fifth line of the on click function.&lt;BR /&gt;
What is wrong with &lt;CODE&gt;for (var ...&lt;/CODE&gt;?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2016 08:33:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265668#M16739</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2016-12-12T08:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiselect input values to a drilldown target?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265669#M16740</link>
      <description>&lt;P&gt;Jeffland,&lt;/P&gt;

&lt;P&gt;I was busy in some work so I wasn't able to implement the code until today. &lt;BR /&gt;
So I modified the code as you mentioned and the URL is still not updating with what I would like it to be. It is showing the default URL. I am trying to modify this for an app which has already been built. So is the URL hard coded ? I am just guessing.&lt;BR /&gt;
Like I mentioned earlier I don't have much knowledge about coding in js. So I felt &lt;BR /&gt;
for(var .. was incorrect since a few examples of .js I saw had only for( ..&lt;/P&gt;

&lt;P&gt;Do you have any suggestions regarding this ? Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2016 13:02:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265669#M16740</guid>
      <dc:creator>aamirs291</dc:creator>
      <dc:date>2016-12-16T13:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiselect input values to a drilldown target?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265670#M16741</link>
      <description>&lt;P&gt;&lt;CODE&gt;for (var i...&lt;/CODE&gt; declares the variable &lt;CODE&gt;i&lt;/CODE&gt; in the scope of the current function, using &lt;CODE&gt;for (i...&lt;/CODE&gt; would make it global - general rule being to use the smallest necessary scope.&lt;BR /&gt;
Are there any errors on your console? Also, I suspect the main question remains: what do you assign to the variable &lt;CODE&gt;table&lt;/CODE&gt;?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2016 13:23:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265670#M16741</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2016-12-16T13:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiselect input values to a drilldown target?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265671#M16742</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;var clickEventGenerator = mvc.Components.get("severity_table");
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above is the modification I did to the code. &lt;EM&gt;severity_table&lt;/EM&gt; is a table on the first page through which the value for severity is found. &lt;BR /&gt;
Eg. If I click on the first row of  &lt;EM&gt;severity_table&lt;/EM&gt; I should get the corresponding value of severity from the first row , click on second row I should get the corresponding value of severity from the second row.. and so on. &lt;BR /&gt;
Any click on the &lt;EM&gt;severity_table&lt;/EM&gt; should start the drilldown to the next page along with the corresponding values for severity and other values like the multiselect inputs. The multiselect inputs are coming from a different panel than the severity table. And in the next page the values of the first page are passed and populated to new panels.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2016 09:56:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265671#M16742</guid>
      <dc:creator>aamirs291</dc:creator>
      <dc:date>2016-12-19T09:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiselect input values to a drilldown target?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265672#M16743</link>
      <description>&lt;P&gt;And you gave your table that id in Simple XML like this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;row&amp;gt;
  &amp;lt;panel&amp;gt;
    &amp;lt;table id="severity_table"&amp;gt;
      &amp;lt;search...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Because then I don't see any reason it shouldn't basically work. Now with your explanation I doubt you can use "row.severity" to get the row of your click just like you could if you were doing this in Simple XML. Try the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;clickEventGenerator.on("click", function(e) {
    e.preventDefault();
    console.log(e);
});
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should only stop the regular drilldown, and leave the &lt;CODE&gt;e&lt;/CODE&gt; element on your console. You can check it to see that it has a &lt;CODE&gt;data&lt;/CODE&gt; attribute which has your click event values. Try that and see if there are errors on your console. When that all works, you should be able to use&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...
tokenString = "?form.severity=" + e.data["click.value"];
...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to get the leftmost cell value for the clicked row.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2016 11:18:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265672#M16743</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2016-12-19T11:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiselect input values to a drilldown target?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265673#M16744</link>
      <description>&lt;P&gt;1) Yes the id in Simple XML is severity_table.&lt;BR /&gt;
2) I opened the Console window on the first page in Chrome and the following is error is what I receive.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&lt;A href="http://localhost:8001/en-US/splunkd/__raw/servicesNS/admin/MyAppName/static/appLogo.png" target="test_blank"&gt;http://localhost:8001/en-US/splunkd/__raw/servicesNS/admin/MyAppName/static/appLogo.png&lt;/A&gt; 
Failed to load resource: the server responded with a status of 404 (Not Found)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;3)You mentioned that I would now be able to get the left most cell value.. But the left most cell doesnt have the value which I need. I might need to change the order of the table to get this working.&lt;/P&gt;

&lt;P&gt;Mainly if modifying the URL works I could then focus on 3) and try to get that working as well. Thanks for following up jeffland.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 05:07:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265673#M16744</guid>
      <dc:creator>aamirs291</dc:creator>
      <dc:date>2016-12-20T05:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiselect input values to a drilldown target?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265674#M16745</link>
      <description>&lt;P&gt;That error has nothing to do with the problem, unfortunately.&lt;BR /&gt;
If it's not the leftmost cell, then you should still be able to get the required row from the &lt;CODE&gt;e&lt;/CODE&gt; object. It has all rows from your table, you access them via &lt;CODE&gt;e.data["row.severity"]&lt;/CODE&gt; assuming your row is named severity (case sensitive of course).&lt;BR /&gt;
You should set a breakpoint on the &lt;CODE&gt;e.preventDefault();&lt;/CODE&gt; row and have a look at the object.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2016 15:10:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265674#M16745</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2016-12-21T15:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiselect input values to a drilldown target?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265675#M16746</link>
      <description>&lt;P&gt;jeffland,&lt;/P&gt;

&lt;P&gt;Apologize for the delay in response. I got sometime to implement this today. I was able to have a look at the "e" object. The error I am facing in the console is as follows : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Uncaught TypeError: Cannot read property 'val' of undefined
    at constructor.eval (eval at globalEval (common.js:1), &amp;lt;anonymous&amp;gt;:21:59)
    at triggerEvents (common.js:205)
    at constructor.trigger (common.js:205)
    at triggerEvents (common.js:205)
    at child.trigger (common.js:205)
    at triggerEvents (common.js:205)
    at child.trigger (common.js:205)
    at eventsApi (common.js:205)
    at child.trigger (common.js:205)
    at child._emitDrilldownEvent (common.js:317)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The console is also highlighting this line of code : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;        tokenString += returnUrldValues(sourceMultiselect.val(), "form.targetMultiselectTokenName");
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It would be helpful if I received a response. Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 05:37:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265675#M16746</guid>
      <dc:creator>aamirs291</dc:creator>
      <dc:date>2017-01-17T05:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiselect input values to a drilldown target?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265676#M16747</link>
      <description>&lt;P&gt;It looks like your code doesn't properly get your multiselect. Did you give it an id in Simple XML? If you didn't change it, it should be "multiselect" as per the line&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var sourceMultiselect = splunkjs.mvc.Components.getInstance("multiselect");
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Your Simple XML should declare the id like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...
&amp;lt;input id="multiselect" type="multiselect" token=...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Jan 2017 10:19:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265676#M16747</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2017-01-17T10:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiselect input values to a drilldown target?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265677#M16748</link>
      <description>&lt;P&gt;That was it.. The input id wasn't set at all.. Thanks a lot jeffland, appreciate your effort as well as the followup. &lt;/P&gt;

&lt;P&gt;There still seems to be one issue though.. The default drilldown is not getting prevented.. i.e there are two pages now.. one with the multiselect search string(default) and another one which is showing up due to the js code you provided. &lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 11:29:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265677#M16748</guid>
      <dc:creator>aamirs291</dc:creator>
      <dc:date>2017-01-17T11:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiselect input values to a drilldown target?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265678#M16749</link>
      <description>&lt;P&gt;That should not be the case if you're using &lt;CODE&gt;e.preventDefault();&lt;/CODE&gt; in the function which you call &lt;CODE&gt;on('click'&lt;/CODE&gt; of the table, i.e.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;clickEventGenerator.on("click", function(e) {
    e.preventDefault(); // Stop default drilldown behavior
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Jan 2017 14:39:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265678#M16749</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2017-01-17T14:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiselect input values to a drilldown target?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265679#M16750</link>
      <description>&lt;P&gt;This finally resolved Jeffland. Thank you. &lt;/P&gt;

&lt;P&gt;I was using the following for drilling down to another page using Simple XML : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   &amp;lt;lnk&amp;gt;
     &amp;lt;![CDATA[ ticket_review?form.severity=$row.severity$&amp;amp;form.ticket_id=$ticket_id$&amp;amp;form.time.earliest=$time.earliest$&amp;amp;form.time.latest=$time.latest$ ]]&amp;gt;
   &amp;lt;/lnk&amp;gt;
 &amp;lt;/drilldown&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So the above needed to be removed from the Simple XML and then the .js code  started working. I think preventDefault means : Stop the drilldown to the search page; because clicking on the table without having the .js code would go to the search page. Adding the .js code would stop this. &lt;/P&gt;

&lt;P&gt;Another answer from you helped in resolving this. &lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/492942/table-drilldown-disable-link-conditionally.html"&gt;https://answers.splunk.com/answers/492942/table-drilldown-disable-link-conditionally.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2017 08:59:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265679#M16750</guid>
      <dc:creator>aamirs291</dc:creator>
      <dc:date>2017-04-28T08:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiselect input values to a drilldown target?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265680#M16751</link>
      <description>&lt;P&gt;As an alternative to the JavaScript route, you could instead use the report search to set a field, then reuse that field in drilldown link:&lt;/P&gt;

&lt;P&gt;With a multiselect producing a search string like  &lt;CODE&gt;(sourcetype=foo OR sourcetype=bar)&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="multiselect" token="sourcetypes" depends="$dt.earliest$,$dt.latest$" searchWhenChanged="true"&amp;gt;
  &amp;lt;label&amp;gt;Source Type&amp;lt;/label&amp;gt;
  &amp;lt;choice value="*"&amp;gt;Show All&amp;lt;/choice&amp;gt;
  &amp;lt;default&amp;gt;Show All&amp;lt;/default&amp;gt;
  &amp;lt;search&amp;gt;
    &amp;lt;query&amp;gt;index=_internal | stats count by sourcetype&amp;lt;/query&amp;gt;
    &amp;lt;earliest&amp;gt;$dt.earliest$&amp;lt;/earliest&amp;gt;
    &amp;lt;latest&amp;gt;$dt.latest$&amp;lt;/latest&amp;gt;
  &amp;lt;/search&amp;gt;
  &amp;lt;fieldForLabel&amp;gt;sourcetype&amp;lt;/fieldForLabel&amp;gt;
  &amp;lt;fieldForValue&amp;gt;sourcetype&amp;lt;/fieldForValue&amp;gt;
  &amp;lt;prefix&amp;gt;(&amp;lt;/prefix&amp;gt;
  &amp;lt;suffix&amp;gt;)&amp;lt;/suffix&amp;gt;
  &amp;lt;valuePrefix&amp;gt;sourcetype=&amp;lt;/valuePrefix&amp;gt;
  &amp;lt;delimiter&amp;gt; OR &amp;lt;/delimiter&amp;gt;
&amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then using the above in the report search as a part of the search as well as setting a field  &lt;CODE&gt;_querystring&lt;/CODE&gt; changing  &lt;CODE&gt;(sourcetype=foo OR sourcetype=bar)&lt;/CODE&gt; into  &lt;CODE&gt;form.sourcetypes=foo&amp;amp;form.sourcetypes=bar&lt;/CODE&gt;.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="_internal" | search $sourcetypes$ | eval _querystring=replace(replace(ltrim(rtrim("$sourcetypes$",")"),"("),"sourcetype=","form.sourcetypes=")," OR ","&amp;amp;") | stats count by sourcetype, _querystring
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Worth pointing out that you have to make sure the field  &lt;CODE&gt;_querystring&lt;/CODE&gt; is in the results and then use dashboard visualisation to hide it.&lt;/P&gt;

&lt;P&gt;Then this can be used in the drilldown link (using &lt;CODE&gt;|n&lt;/CODE&gt; to make sure it doesn't get escaped):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;link&amp;gt;
  &amp;lt;![CDATA[mutliselect-drilldown?form.dt.earliest=$earliest$&amp;amp;form.dt.latest=$latest$&amp;amp;$row._querystring|n$]]&amp;gt;
&amp;lt;/link&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Working example:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Multiselect Drilldown&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="time" token="dt" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;
        &amp;lt;earliest&amp;gt;@d&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="multiselect" token="sourcetypes" depends="$dt.earliest$,$dt.latest$" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Source Type&amp;lt;/label&amp;gt;
      &amp;lt;choice value="*"&amp;gt;Show All&amp;lt;/choice&amp;gt;
      &amp;lt;default&amp;gt;Show All&amp;lt;/default&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;index=_internal | stats count by sourcetype&amp;lt;/query&amp;gt;
        &amp;lt;earliest&amp;gt;$dt.earliest$&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;$dt.latest$&amp;lt;/latest&amp;gt;
      &amp;lt;/search&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;sourcetype&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;sourcetype&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;prefix&amp;gt;(&amp;lt;/prefix&amp;gt;
      &amp;lt;suffix&amp;gt;)&amp;lt;/suffix&amp;gt;
      &amp;lt;valuePrefix&amp;gt;sourcetype=&amp;lt;/valuePrefix&amp;gt;
      &amp;lt;delimiter&amp;gt; OR &amp;lt;/delimiter&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;title&amp;gt;Source Types&amp;lt;/title&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;
            &amp;lt;![CDATA[index="_internal" | search $sourcetypes$ | eval _querystring=replace(replace(ltrim(rtrim("$sourcetypes$",")"),"("),"sourcetype=","form.sourcetypes=")," OR ","&amp;amp;") | stats count by sourcetype, _querystring]]&amp;gt;
          &amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$dt.earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$dt.latest$&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="count"&amp;gt;10&amp;lt;/option&amp;gt;
        &amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;row&amp;lt;/option&amp;gt;
        &amp;lt;option name="rowNumbers"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
        &amp;lt;fields&amp;gt;["sourcetype","count"]&amp;lt;/fields&amp;gt;
        &amp;lt;drilldown&amp;gt;
          &amp;lt;link&amp;gt;
            &amp;lt;![CDATA[mutliselect-drilldown?form.dt.earliest=$earliest$&amp;amp;form.dt.latest=$latest$&amp;amp;$row._querystring|n$]]&amp;gt;
          &amp;lt;/link&amp;gt;
        &amp;lt;/drilldown&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Check the working project out here: &lt;A href="https://github.com/mcwarman/splunk-multiselect-drilldown/"&gt;https://github.com/mcwarman/splunk-multiselect-drilldown/&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2017 11:17:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265680#M16751</guid>
      <dc:creator>mwarman</dc:creator>
      <dc:date>2017-06-06T11:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiselect input values to a drilldown target?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265681#M16752</link>
      <description>&lt;P&gt;Thank you for the alternative mwarman. I will look into implementing this as well when I get the chance to.  &lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2017 11:39:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiselect-input-values-to-a-drilldown-target/m-p/265681#M16752</guid>
      <dc:creator>aamirs291</dc:creator>
      <dc:date>2017-06-06T11:39:41Z</dc:date>
    </item>
  </channel>
</rss>

