<?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: selectValues method ignores state in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/selectValues-method-ignores-state/m-p/1439631#M9115</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for answer! Tell me please, how create state using api in my function to select values with this state? My function gets only name of state that i want to use.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Dec 2017 09:22:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-12-07T09:22:08Z</dc:date>
    <item>
      <title>selectValues method ignores state</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/selectValues-method-ignores-state/m-p/1439629#M9113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I try to use field api. I have array of string values, field name and state name.&lt;/P&gt;&lt;P&gt;My function in extension is something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function selectByValue(fieldname,value,state){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var app = qlik.currApp();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var field = app.field(fieldname,state);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt;field.clear;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt;field.selectValues(value,true,true);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;In result. I see all selected values in a field and it ignores state.&lt;/P&gt;&lt;P&gt;How do i use selectValues with state?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2017 13:34:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/selectValues-method-ignores-state/m-p/1439629#M9113</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-06T13:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: selectValues method ignores state</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/selectValues-method-ignores-state/m-p/1439630#M9114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Cool with someone that tries to use state! Have you created the state?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To clear a field you need to call the &lt;A href="http://help.qlik.com/en-US/sense-developer/November2017/Subsystems/APIs/Content/CapabilityAPIs/FieldAPI/clear-method.htm"&gt;clear&lt;/A&gt; method :&lt;/P&gt;&lt;P&gt;field.clear();&amp;nbsp; //your example is missing the ()&amp;nbsp; which means the function will not be called&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The clear method returns a promise, which resolves when QIX engine replies to the call. If you want to have control over the order of the calls (and you probably do) you need to wait for the clear before making the selection, like this:&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_15126366228858683" jivemacro_uid="_15126366228858683" modifiedtitle="true"&gt;
&lt;P&gt;field.clear().then(function(){&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;field.selectValues(value,true,true);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;});&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erik Wetterberg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2017 08:51:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/selectValues-method-ignores-state/m-p/1439630#M9114</guid>
      <dc:creator>ErikWetterberg</dc:creator>
      <dc:date>2017-12-07T08:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: selectValues method ignores state</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/selectValues-method-ignores-state/m-p/1439631#M9115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for answer! Tell me please, how create state using api in my function to select values with this state? My function gets only name of state that i want to use.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2017 09:22:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/selectValues-method-ignores-state/m-p/1439631#M9115</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-07T09:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: selectValues method ignores state</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/selectValues-method-ignores-state/m-p/1439632#M9116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You can create a new state with the &lt;A href="http://help.qlik.com/en-US/sense-developer/November2017/Subsystems/APIs/Content/CapabilityAPIs/AppAPI/addAlternateState-method.htm"&gt;addAlternateState &lt;/A&gt;method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erik Wetterberg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Dec 2017 06:08:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/selectValues-method-ignores-state/m-p/1439632#M9116</guid>
      <dc:creator>ErikWetterberg</dc:creator>
      <dc:date>2017-12-08T06:08:58Z</dc:date>
    </item>
    <item>
      <title>Re: selectValues method ignores state</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/selectValues-method-ignores-state/m-p/1439633#M9117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much! It's worked&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Dec 2017 08:21:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/selectValues-method-ignores-state/m-p/1439633#M9117</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-08T08:21:05Z</dc:date>
    </item>
  </channel>
</rss>

