<?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: Cannot access the selections array of a Selection State Object in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Cannot-access-the-selections-array-of-a-Selection-State-Object/m-p/1540768#M9974</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;this is a timing problem. When you call the selectionState() method you will get an object back and the API will request the data from the QIX engine. It will also keep the selectionstate up to date. To be notified when the selections are available use the onData listener, as described here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/sense-developer/November2018/Subsystems/APIs/Content/Sense_ClientAPIs/CapabilityAPIs/SelectionAPI/QSelectionState.htm" target="_blank"&gt;https://help.qlik.com/en-US/sense-developer/November2018/Subsystems/APIs/Content/Sense_ClientAPIs/CapabilityAPIs/SelectionAPI/QSelectionState.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That fact that it looks OK in the console is because the console checks the state of the object when you expandit, not when the message is printed.&lt;/P&gt;</description>
    <pubDate>Thu, 07 Feb 2019 10:16:51 GMT</pubDate>
    <dc:creator>ErikWetterberg</dc:creator>
    <dc:date>2019-02-07T10:16:51Z</dc:date>
    <item>
      <title>Cannot access the selections array of a Selection State Object</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Cannot-access-the-selections-array-of-a-Selection-State-Object/m-p/1540752#M9973</link>
      <description>&lt;P&gt;Dear community,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm trying to make use of the Selection API and retrieve all applied selections on every field in an array. By means of the selectionState() method I was able to get the selections array through:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;selState = app.selectionState();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;console.log(selState.selections);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The result in the console is as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="SelectionState.JPG" style="width: 593px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/5396iA71AAEE84CC219F4/image-dimensions/593x71?v=v2" width="593" height="71" role="button" title="SelectionState.JPG" alt="SelectionState.JPG" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now, when I try to access the first element of the array with selState.selections[0] I'm getting an "undefined" error. Hence, I'm wondering how else I can access the particular elements of that selection array. Can it be that there are certain getter methods for this type of array/object?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;BR /&gt;Juergen&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 06:39:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Cannot-access-the-selections-array-of-a-Selection-State-Object/m-p/1540752#M9973</guid>
      <dc:creator>juergenschiemann</dc:creator>
      <dc:date>2024-11-16T06:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot access the selections array of a Selection State Object</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Cannot-access-the-selections-array-of-a-Selection-State-Object/m-p/1540768#M9974</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;this is a timing problem. When you call the selectionState() method you will get an object back and the API will request the data from the QIX engine. It will also keep the selectionstate up to date. To be notified when the selections are available use the onData listener, as described here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/sense-developer/November2018/Subsystems/APIs/Content/Sense_ClientAPIs/CapabilityAPIs/SelectionAPI/QSelectionState.htm" target="_blank"&gt;https://help.qlik.com/en-US/sense-developer/November2018/Subsystems/APIs/Content/Sense_ClientAPIs/CapabilityAPIs/SelectionAPI/QSelectionState.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That fact that it looks OK in the console is because the console checks the state of the object when you expandit, not when the message is printed.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2019 10:16:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Cannot-access-the-selections-array-of-a-Selection-State-Object/m-p/1540768#M9974</guid>
      <dc:creator>ErikWetterberg</dc:creator>
      <dc:date>2019-02-07T10:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot access the selections array of a Selection State Object</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Cannot-access-the-selections-array-of-a-Selection-State-Object/m-p/1540882#M9975</link>
      <description>Many thanks, Erik, this guided me in the right direction and I've learned something in addition.</description>
      <pubDate>Thu, 07 Feb 2019 12:48:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Cannot-access-the-selections-array-of-a-Selection-State-Object/m-p/1540882#M9975</guid>
      <dc:creator>juergenschiemann</dc:creator>
      <dc:date>2019-02-07T12:48:29Z</dc:date>
    </item>
  </channel>
</rss>

