<?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 value of a variable with a widget? in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/How-to-get-the-value-of-a-variable-with-a-widget/m-p/1118928#M19306</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@Stefan: Thank you for your response! I am looking forward to the new version of Qlik Sense.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Such a widget can also be developed using Qlik Sense 3.0. I developed the widget using the following method.&lt;/P&gt;&lt;P&gt;To set the value of a variable, use a html button with ng-click="&lt;SPAN style="color: #000000; font-family: Consolas, Monaco, 'Andale Mono', monospace; font-size: 12px; background-color: #fafafa;"&gt;app&lt;/SPAN&gt;&lt;SPAN class="token punctuation" style="color: #999999; font-family: Consolas, Monaco, 'Andale Mono', monospace; font-size: 12px; background-color: #fafafa;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Consolas, Monaco, 'Andale Mono', monospace; font-size: 12px; background-color: #fafafa;"&gt;variable&lt;/SPAN&gt;&lt;SPAN class="token punctuation" style="color: #999999; font-family: Consolas, Monaco, 'Andale Mono', monospace; font-size: 12px; background-color: #fafafa;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function" style="color: #000000; font-family: Consolas, Monaco, 'Andale Mono', monospace; font-size: 12px; background-color: #fafafa;"&gt;setContent&lt;SPAN class="token punctuation" style="color: #999999;"&gt;(&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="token string" style="color: #b22222; font-family: Consolas, Monaco, 'Andale Mono', monospace; font-size: 12px; background-color: #fafafa;"&gt;'MYVAR'&lt;/SPAN&gt;&lt;SPAN class="token punctuation" style="color: #999999; font-family: Consolas, Monaco, 'Andale Mono', monospace; font-size: 12px; background-color: #fafafa;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token string" style="color: #b22222; font-family: Consolas, Monaco, 'Andale Mono', monospace; font-size: 12px; background-color: #fafafa;"&gt;'1'&lt;/SPAN&gt;&lt;SPAN class="token punctuation" style="color: #999999; font-family: Consolas, Monaco, 'Andale Mono', monospace; font-size: 12px; background-color: #fafafa;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation" style="color: #999999; font-family: Consolas, Monaco, 'Andale Mono', monospace; font-size: 12px; background-color: #fafafa;"&gt;;&lt;/SPAN&gt;".&lt;/P&gt;&lt;P&gt;To get the value of a variable, create an input field in the properties (e.g. named &lt;EM&gt;myvar&lt;/EM&gt;) of the widget and type there =$(MYVAR). You can use this value by referencing &lt;EM&gt;settings.myvar&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;This works if the variable has a nummeric value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;div&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;select ng-model="selectVal" &lt;STRONG&gt;ng-init="opt=settings.selVarValue"&lt;/STRONG&gt; &lt;STRONG&gt;ng-change="app.variable.setContent(settings.selVarName, selectVal);"&lt;/STRONG&gt; class="lui-select"&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;option ng-selected="opt==1" value="1"&amp;gt;{{settings.opt&lt;SPAN style="font-size: 13.3333px;"&gt;Label&lt;/SPAN&gt;1}}&amp;lt;/option&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;option ng-selected="opt==2" value="2"&amp;gt;{{settings.opt&lt;SPAN style="font-size: 13.3333px;"&gt;Label&lt;/SPAN&gt;2}}&amp;lt;/option&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;option ng-selected="opt==3" value="3"&amp;gt;{{settings.optLabel3}}&amp;lt;/option&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;/select&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 Aug 2016 22:32:10 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-08-26T22:32:10Z</dc:date>
    <item>
      <title>How to get the value of a variable with a widget?</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-get-the-value-of-a-variable-with-a-widget/m-p/1118925#M19303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Hello everybody,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;I want to create a widget which gets and sets the value of a variable by using a drop-down list in Qlik Sense.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;I could realize a drop-down list which sets a variable by using the setContent method from the Variable API. However, I have a problem with getting the value of a variable since the appropriate methods from the Variable API use a callback function. Is there a possibility to realize such a widget?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;I am new to Qlik Sense development and I have some basic knowledge in AngularJS.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Thanks a lot in advance for your responses.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Kind regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Leon&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2016 08:39:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-get-the-value-of-a-variable-with-a-widget/m-p/1118925#M19303</guid>
      <dc:creator />
      <dc:date>2016-08-03T08:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the value of a variable with a widget?</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-get-the-value-of-a-variable-with-a-widget/m-p/1118926#M19304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Leon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am also interested in knowing if it possible to use widgets in order to achieve such behavior.&lt;/P&gt;&lt;P&gt;Did you find anything?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Aug 2016 09:46:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-get-the-value-of-a-variable-with-a-widget/m-p/1118926#M19304</guid>
      <dc:creator>1000qlik</dc:creator>
      <dc:date>2016-08-15T09:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the value of a variable with a widget?</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-get-the-value-of-a-variable-with-a-widget/m-p/1118927#M19305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;this can currently not be achieved (based on Widget in Qlik Sense 3.0). But we are soon publishing a new API in Qlik Sense 3.1 that will allow you to get to the desired result.&lt;/P&gt;&lt;P&gt;Stay tuned!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Aug 2016 19:33:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-get-the-value-of-a-variable-with-a-widget/m-p/1118927#M19305</guid>
      <dc:creator>Stefan_Walther</dc:creator>
      <dc:date>2016-08-22T19:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the value of a variable with a widget?</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-get-the-value-of-a-variable-with-a-widget/m-p/1118928#M19306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@Stefan: Thank you for your response! I am looking forward to the new version of Qlik Sense.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Such a widget can also be developed using Qlik Sense 3.0. I developed the widget using the following method.&lt;/P&gt;&lt;P&gt;To set the value of a variable, use a html button with ng-click="&lt;SPAN style="color: #000000; font-family: Consolas, Monaco, 'Andale Mono', monospace; font-size: 12px; background-color: #fafafa;"&gt;app&lt;/SPAN&gt;&lt;SPAN class="token punctuation" style="color: #999999; font-family: Consolas, Monaco, 'Andale Mono', monospace; font-size: 12px; background-color: #fafafa;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Consolas, Monaco, 'Andale Mono', monospace; font-size: 12px; background-color: #fafafa;"&gt;variable&lt;/SPAN&gt;&lt;SPAN class="token punctuation" style="color: #999999; font-family: Consolas, Monaco, 'Andale Mono', monospace; font-size: 12px; background-color: #fafafa;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function" style="color: #000000; font-family: Consolas, Monaco, 'Andale Mono', monospace; font-size: 12px; background-color: #fafafa;"&gt;setContent&lt;SPAN class="token punctuation" style="color: #999999;"&gt;(&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="token string" style="color: #b22222; font-family: Consolas, Monaco, 'Andale Mono', monospace; font-size: 12px; background-color: #fafafa;"&gt;'MYVAR'&lt;/SPAN&gt;&lt;SPAN class="token punctuation" style="color: #999999; font-family: Consolas, Monaco, 'Andale Mono', monospace; font-size: 12px; background-color: #fafafa;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token string" style="color: #b22222; font-family: Consolas, Monaco, 'Andale Mono', monospace; font-size: 12px; background-color: #fafafa;"&gt;'1'&lt;/SPAN&gt;&lt;SPAN class="token punctuation" style="color: #999999; font-family: Consolas, Monaco, 'Andale Mono', monospace; font-size: 12px; background-color: #fafafa;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation" style="color: #999999; font-family: Consolas, Monaco, 'Andale Mono', monospace; font-size: 12px; background-color: #fafafa;"&gt;;&lt;/SPAN&gt;".&lt;/P&gt;&lt;P&gt;To get the value of a variable, create an input field in the properties (e.g. named &lt;EM&gt;myvar&lt;/EM&gt;) of the widget and type there =$(MYVAR). You can use this value by referencing &lt;EM&gt;settings.myvar&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;This works if the variable has a nummeric value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;div&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;select ng-model="selectVal" &lt;STRONG&gt;ng-init="opt=settings.selVarValue"&lt;/STRONG&gt; &lt;STRONG&gt;ng-change="app.variable.setContent(settings.selVarName, selectVal);"&lt;/STRONG&gt; class="lui-select"&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;option ng-selected="opt==1" value="1"&amp;gt;{{settings.opt&lt;SPAN style="font-size: 13.3333px;"&gt;Label&lt;/SPAN&gt;1}}&amp;lt;/option&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;option ng-selected="opt==2" value="2"&amp;gt;{{settings.opt&lt;SPAN style="font-size: 13.3333px;"&gt;Label&lt;/SPAN&gt;2}}&amp;lt;/option&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;option ng-selected="opt==3" value="3"&amp;gt;{{settings.optLabel3}}&amp;lt;/option&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;/select&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Aug 2016 22:32:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-get-the-value-of-a-variable-with-a-widget/m-p/1118928#M19306</guid>
      <dc:creator />
      <dc:date>2016-08-26T22:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the value of a variable with a widget?</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-get-the-value-of-a-variable-with-a-widget/m-p/1118929#M19307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Leon, are you sure API app.variable.* works in widgets?&lt;/P&gt;&lt;P&gt;My very simple code:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;lt;lui-select x-model="value" ng-change="app.variable.setContent('varMeasure', '1');"&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; &amp;lt;option value="1"&amp;gt;First&amp;lt;/option&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; &amp;lt;option value="2"&amp;gt;Second&amp;lt;/option&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; &amp;lt;option value="3"&amp;gt;Third&amp;lt;/option&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;lt;/lui-select&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;leads to js error:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;Cannot read property 'getVariableByName' of undefined...&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 May 2017 20:02:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-get-the-value-of-a-variable-with-a-widget/m-p/1118929#M19307</guid>
      <dc:creator />
      <dc:date>2017-05-20T20:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the value of a variable with a widget?</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-get-the-value-of-a-variable-with-a-widget/m-p/1996665#M82543</link>
      <description>&lt;P&gt;I am trying to get this to work in a widget&lt;BR /&gt;&lt;BR /&gt;&amp;lt;div class="lui-input-group"&amp;gt;&lt;BR /&gt;&amp;lt;input class="lui-input-group__item lui-input-group__input lui-input" value={{settings.property4}} ng-change=app.variable.setContent('jtest','did I do it')&amp;gt;&amp;lt;/input&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;The default value gets set by the variable but I can not get the change in the input box to be reflected back in the in the variable&lt;BR /&gt;&lt;BR /&gt;Does it currently work?&amp;nbsp; Has anyone managed to get this to work?&amp;nbsp;&amp;nbsp; I do not believe it works for the select ether&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 14:34:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-get-the-value-of-a-variable-with-a-widget/m-p/1996665#M82543</guid>
      <dc:creator>JShum</dc:creator>
      <dc:date>2022-10-25T14:34:41Z</dc:date>
    </item>
  </channel>
</rss>

