<?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: Splunk button javascript unset token in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-button-javascript-unset-token-Is-there-a-method-to-unset/m-p/699646#M57353</link>
    <description>&lt;P&gt;hey guys, the depends thing on dashboards worked for me only when i did this trick. i'm not sure why.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;mvc.Components.get("default").unset("myToken");
mvc.Components.get("submitted").unset("myToken");&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Sep 2024 22:11:38 GMT</pubDate>
    <dc:creator>highsplunker</dc:creator>
    <dc:date>2024-09-19T22:11:38Z</dc:date>
    <item>
      <title>Splunk button javascript unset token- Is there a method to unset the splunk's token after the page refresh?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-button-javascript-unset-token-Is-there-a-method-to-unset/m-p/504426#M33374</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a button that take values from splunk's tokens, launch a search that update a KV Store and refresh the page. &lt;/P&gt;
&lt;P&gt;Is there a method to unset the splunk's token after the page refresh?&lt;/P&gt;
&lt;P&gt;I tried with the "tokens.unset("name of the token", null);" command in javascript but this method didn't work for me.&lt;/P&gt;
&lt;P&gt;I took all the tokens with this command "var tokens = mvc.Components.get("default");"&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Mauro&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 12:01:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-button-javascript-unset-token-Is-there-a-method-to-unset/m-p/504426#M33374</guid>
      <dc:creator>maurobissante</dc:creator>
      <dc:date>2022-12-05T12:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk button javascript unset token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-button-javascript-unset-token-Is-there-a-method-to-unset/m-p/504604#M33399</link>
      <description>&lt;P&gt;&lt;SPAN&gt;How are you currently updating your KV Store or refreshing the page through JS? One of those can have the code to unset the token.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also unset token code is something like the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;tokens.unset("yourTokenName");&lt;/LI-CODE&gt;&lt;P&gt;Besides depending on your use case you may want to unset both &lt;STRONG&gt;default&lt;/STRONG&gt; and &lt;STRONG&gt;submitted&lt;/STRONG&gt; token model. Further, you would need to ensure that unsetting the token does not trigger unwanted execution of token change event which you may already have.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 13:15:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-button-javascript-unset-token-Is-there-a-method-to-unset/m-p/504604#M33399</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-06-16T13:15:55Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk button javascript unset token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-button-javascript-unset-token-Is-there-a-method-to-unset/m-p/506162#M33627</link>
      <description>&lt;P&gt;In JS with the button I submit a search that update the KVStore and refresh the page.&lt;/P&gt;&lt;P&gt;The token came from an input fields where I set the new values of the KVStore.&lt;/P&gt;&lt;P&gt;After the refresh I try to unset the token.&lt;/P&gt;&lt;P&gt;The problem is that, after the refresh, the input fields remain full of the value of the token, instead of blank inputs.&lt;/P&gt;&lt;P&gt;I tried to use your command before the window.location.reload(); but it didn't work and the input form remained with the old values.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mauro&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jun 2020 14:39:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-button-javascript-unset-token-Is-there-a-method-to-unset/m-p/506162#M33627</guid>
      <dc:creator>maurobissante</dc:creator>
      <dc:date>2020-06-25T14:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk button javascript unset token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-button-javascript-unset-token-Is-there-a-method-to-unset/m-p/623107#M51102</link>
      <description>&lt;P&gt;Try the code below to change the selection of your input.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;        function unsetToken(name) {
            defaultTokenModelun.unset(name);
            submittedTokenModelun.unset(name);
        }
        unsetToken("form.TEXT_FIELD")&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 03 Dec 2022 16:23:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-button-javascript-unset-token-Is-there-a-method-to-unset/m-p/623107#M51102</guid>
      <dc:creator>tmurata_splunk</dc:creator>
      <dc:date>2022-12-03T16:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk button javascript unset token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-button-javascript-unset-token-Is-there-a-method-to-unset/m-p/698030#M57228</link>
      <description>&lt;P&gt;ok for me.&lt;/P&gt;&lt;P&gt;i just put this line into my js:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;mvc.Components.get("default").unset("myToken");&lt;/LI-CODE&gt;&lt;P&gt;thanks a lot.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2024 07:03:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-button-javascript-unset-token-Is-there-a-method-to-unset/m-p/698030#M57228</guid>
      <dc:creator>highsplunker</dc:creator>
      <dc:date>2024-09-03T07:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk button javascript unset token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-button-javascript-unset-token-Is-there-a-method-to-unset/m-p/699646#M57353</link>
      <description>&lt;P&gt;hey guys, the depends thing on dashboards worked for me only when i did this trick. i'm not sure why.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;mvc.Components.get("default").unset("myToken");
mvc.Components.get("submitted").unset("myToken");&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2024 22:11:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-button-javascript-unset-token-Is-there-a-method-to-unset/m-p/699646#M57353</guid>
      <dc:creator>highsplunker</dc:creator>
      <dc:date>2024-09-19T22:11:38Z</dc:date>
    </item>
  </channel>
</rss>

