<?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 get the token value inside my javascript code to use it for if and else condition? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-the-token-value-inside-my-javascript-code-to-use-it/m-p/246167#M45129</link>
    <description>&lt;P&gt;I have the code inside the script tag.  Is there anyway I can extract the token value inside the script tag?&lt;/P&gt;</description>
    <pubDate>Thu, 25 Aug 2016 11:53:35 GMT</pubDate>
    <dc:creator>simona2121</dc:creator>
    <dc:date>2016-08-25T11:53:35Z</dc:date>
    <item>
      <title>How to get the token value inside my javascript code to use it for if and else condition?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-the-token-value-inside-my-javascript-code-to-use-it/m-p/246165#M45127</link>
      <description>&lt;P&gt;// Access the "submitted" token model&lt;BR /&gt;
    var tokens = mvc.Components.get("submitted");&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;// Retrieve the value of a token $mytoken$
var tokenValue = tokens.get("mytoken");
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am using the above code inside &lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2016 10:39:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-the-token-value-inside-my-javascript-code-to-use-it/m-p/246165#M45127</guid>
      <dc:creator>simona2121</dc:creator>
      <dc:date>2016-08-25T10:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the token value inside my javascript code to use it for if and else condition?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-the-token-value-inside-my-javascript-code-to-use-it/m-p/246166#M45128</link>
      <description>&lt;P&gt;You need to get the token value using the form.tokenname of the element.&lt;/P&gt;

&lt;P&gt;I.e if I have a input element as &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input id="category_mcon_id" token="category_mcon_form" type="multiselect"&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can get the value using following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; submittedTokens.get('form.category_mcon_form')
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Aug 2016 11:32:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-the-token-value-inside-my-javascript-code-to-use-it/m-p/246166#M45128</guid>
      <dc:creator>hardikJsheth</dc:creator>
      <dc:date>2016-08-25T11:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the token value inside my javascript code to use it for if and else condition?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-the-token-value-inside-my-javascript-code-to-use-it/m-p/246167#M45129</link>
      <description>&lt;P&gt;I have the code inside the script tag.  Is there anyway I can extract the token value inside the script tag?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2016 11:53:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-the-token-value-inside-my-javascript-code-to-use-it/m-p/246167#M45129</guid>
      <dc:creator>simona2121</dc:creator>
      <dc:date>2016-08-25T11:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the token value inside my javascript code to use it for if and else condition?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-the-token-value-inside-my-javascript-code-to-use-it/m-p/246168#M45130</link>
      <description>&lt;P&gt;I have the code inside the script tag. Is there anyway I can extract the token value inside the script tag?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2016 11:54:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-the-token-value-inside-my-javascript-code-to-use-it/m-p/246168#M45130</guid>
      <dc:creator>simona2121</dc:creator>
      <dc:date>2016-08-25T11:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the token value inside my javascript code to use it for if and else condition?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-the-token-value-inside-my-javascript-code-to-use-it/m-p/246169#M45131</link>
      <description>&lt;P&gt;I have used this code in a separate js file, which is included in the xml file. I have never tried to use it in script tag, but I think it should work.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2016 12:31:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-the-token-value-inside-my-javascript-code-to-use-it/m-p/246169#M45131</guid>
      <dc:creator>hardikJsheth</dc:creator>
      <dc:date>2016-08-25T12:31:58Z</dc:date>
    </item>
  </channel>
</rss>

