<?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 Trouble with Capability API - selectValues in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Trouble-with-Capability-API-selectValues/m-p/132723#M1871</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't get thhe selectValues method to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the example on &lt;A href="https://help.qlik.com/en-US/sense-developer/June2018/Subsystems/APIs/Content/CapabilityAPIs/FieldAPI/selectValues-method.htm" title="https://help.qlik.com/en-US/sense-developer/June2018/Subsystems/APIs/Content/CapabilityAPIs/FieldAPI/selectValues-method.htm"&gt;https://help.qlik.com/en-US/sense-developer/June2018/Subsystems/APIs/Content/CapabilityAPIs/FieldAPI/selectValues-method…&lt;/A&gt;, I am trying to set field values using qText values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, I have a Weekday field that looks like this (from app1.field("Weekday").getData()):&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="210656" alt="weekday.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/210656_weekday.PNG" style="height: 388px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried selecting values by using:&lt;/P&gt;&lt;P&gt;weekdayField.selectValues([{qText: "Thu"}], false, false);&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;weekdayField.selectValues(["Thu"], false, false);&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;weekdayField.selectValues(["Thu", "Fri"], true, true);&lt;/P&gt;&lt;P&gt;but none of these work. They don't produce a JavaScript error, but they don't do anything.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am, however, able to select values by index using:&lt;/P&gt;&lt;P&gt;weekdayField.select([1, 3], true, true); &amp;lt;-- works like a charm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What am I doing wrong since selectValues isn't working?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Aug 2018 10:37:26 GMT</pubDate>
    <dc:creator>zrednaz1</dc:creator>
    <dc:date>2018-08-13T10:37:26Z</dc:date>
    <item>
      <title>Trouble with Capability API - selectValues</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Trouble-with-Capability-API-selectValues/m-p/132723#M1871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't get thhe selectValues method to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the example on &lt;A href="https://help.qlik.com/en-US/sense-developer/June2018/Subsystems/APIs/Content/CapabilityAPIs/FieldAPI/selectValues-method.htm" title="https://help.qlik.com/en-US/sense-developer/June2018/Subsystems/APIs/Content/CapabilityAPIs/FieldAPI/selectValues-method.htm"&gt;https://help.qlik.com/en-US/sense-developer/June2018/Subsystems/APIs/Content/CapabilityAPIs/FieldAPI/selectValues-method…&lt;/A&gt;, I am trying to set field values using qText values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, I have a Weekday field that looks like this (from app1.field("Weekday").getData()):&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="210656" alt="weekday.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/210656_weekday.PNG" style="height: 388px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried selecting values by using:&lt;/P&gt;&lt;P&gt;weekdayField.selectValues([{qText: "Thu"}], false, false);&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;weekdayField.selectValues(["Thu"], false, false);&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;weekdayField.selectValues(["Thu", "Fri"], true, true);&lt;/P&gt;&lt;P&gt;but none of these work. They don't produce a JavaScript error, but they don't do anything.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am, however, able to select values by index using:&lt;/P&gt;&lt;P&gt;weekdayField.select([1, 3], true, true); &amp;lt;-- works like a charm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What am I doing wrong since selectValues isn't working?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2018 10:37:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Trouble-with-Capability-API-selectValues/m-p/132723#M1871</guid>
      <dc:creator>zrednaz1</dc:creator>
      <dc:date>2018-08-13T10:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with Capability API - selectValues</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Trouble-with-Capability-API-selectValues/m-p/132724#M1872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be try like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An easy way to check if a value has a numeric value is single configurator:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;open your app in Single Configurator&lt;/LI&gt;&lt;LI&gt;in the option pannel under `Apply selections` - click on `Add data`&lt;/LI&gt;&lt;LI&gt;select field =&amp;gt; select value&lt;/LI&gt;&lt;LI&gt;check your URL&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Example from Helpdesk Management app the Filed Dat with value 10/14/2010 is resulting in the URL as `&amp;amp;select=clearall&amp;amp;select=Date,40465` &amp;lt;=&lt;STRONG&gt; `&lt;SPAN style="font-size: 13.3333px;"&gt;40465&lt;/SPAN&gt;`&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Refer this link:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A href="https://community.qlik.com/thread/300690"&gt;app.field('Field').selectValues() Don't work on all fields&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2018 14:16:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Trouble-with-Capability-API-selectValues/m-p/132724#M1872</guid>
      <dc:creator>BalaBhaskar_Qlik</dc:creator>
      <dc:date>2018-08-13T14:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with Capability API - selectValues</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Trouble-with-Capability-API-selectValues/m-p/132725#M1873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Refer this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-thread-small" data-containerid="2159" data-containertype="14" data-objectid="288639" data-objecttype="1" href="https://community.qlik.com/thread/288639"&gt;https://community.qlik.com/thread/288639&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2018 14:34:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Trouble-with-Capability-API-selectValues/m-p/132725#M1873</guid>
      <dc:creator>BalaBhaskar_Qlik</dc:creator>
      <dc:date>2018-08-13T14:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with Capability API - selectValues</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Trouble-with-Capability-API-selectValues/m-p/132726#M1874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bala, you are right. I tried your suggestion and sure enough, "myField.selectValues([43282], false, false);" works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, this is not very useful to me since I need to set values based on the display values that the following function gives me in the first place:&lt;/P&gt;&lt;P&gt;app1.getList("CurrentSelections", function(reply) {&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;This function returns values in the visual format (e.g. "Aug 2018"), but then when I want to set this loaded value later using selectValues, I have to use '&lt;SPAN style="font-size: 13.3333px;"&gt;43282' instead. Not too intuitive...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Right now it looks like my best bet is to translate the visual value (e.g. "Aug 2018") to an index number by using getData(), then set the value using field.select([indexNo], false, true). It's a bit of a detour, but I'm hoping it will get the job done.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2018 15:10:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Trouble-with-Capability-API-selectValues/m-p/132726#M1874</guid>
      <dc:creator>zrednaz1</dc:creator>
      <dc:date>2018-08-13T15:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with Capability API - selectValues</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Trouble-with-Capability-API-selectValues/m-p/1509392#M9510</link>
      <description>&lt;P&gt;I'm having the exact same challenge. My extension allows users to save the selection state and then re-apply at a later stage. But when re-applying selections, I can't consistently use selectValues, as some of those fields might be in date/numeric format and won't work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the same time, the SelectionObjectDef which is returned by&amp;nbsp;app.selectionState or "CurrentSelections" does not contain the qNum property for each selection value. Just great.&lt;/P&gt;&lt;P&gt;So the challenge is, how do you determine if the field value is a date or not? To Javascript it's just a string.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Similar to your suggestion, looks like for every selection I want to apply, I'll have to get the field from Sense so that at least I have the qText/qNum equivalent and can determine if I should use the string or number when calling selectValues. A bit of an overkill I wanted to avoid, but can't see any other options at the moment.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2018 00:24:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Trouble-with-Capability-API-selectValues/m-p/1509392#M9510</guid>
      <dc:creator>sebastian_serva</dc:creator>
      <dc:date>2018-11-20T00:24:15Z</dc:date>
    </item>
  </channel>
</rss>

