<?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: Mashup: Issue with getting all selection options in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Mashup-Issue-with-getting-all-selection-options/m-p/2497095#M21629</link>
    <description>&lt;P&gt;Ok that is clear now. Below code is an example of getting all values from a field. And for doing this we need to create a listbox starting from your field name. If you are able to get current selections fields, then you should create a listbox on top of all of them for getting values.&lt;BR /&gt;This tecquinique is needed because you cannot get more than 6 values from current selections object, and this what happened in the product behind the scenes.&lt;/P&gt;
&lt;P&gt;When you can get values from listbox, using the right sort criteria you will find selected values at the top, and looking at qState prop you can understand if a values is selected (S), optional (O), excluded (X) and so on.&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;import qlikApi from '@qlik/api';
const config = {
	authType: "oauth2",
	host: "_tenant_.eu.qlikcloud.com",
	clientId: "_OAuth_clientId",
	redirectUri: "https://localhost:8080/oauth_callback.html",
	accessTokenStorage: "session"
};

qlikApi.auth.setDefaultHostConfig(config);

// open new app session
const appSession = qlikApi.qix.openAppSession("_appId_");
// get the "qix document (qlik app)"
const app = await appSession.getDoc();
const sessionListboxDef = {
	"qInfo": {
		"qType": "ListObject"
	},
	"qListObjectDef": {
		"qStateName": "$",
		"qLibraryId": "",
		"qDef": {
			"qFieldDefs": [
				"_youtFieldName_"
			],
			"qSortCriterias": [
				{
					"qSortByState": 1
				}
			]
		}
	}
}
const sessionListbox = await app.createSessionObject(sessionListboxDef);
const sessionListboxLayout = await sessionListbox.getLayout();
//Read listbox height
const sessionListboxHeight = sessionListboxLayout.qListObject.qSize.qcy
//We need height for understanding how many values we have. Use this for pagination when need to get all data
const sessionListboxDataDef = {
	"qPath": "/qListObjectDef",
	"qPages": [
		{
			"qLeft": 0,
			"qTop": 0,
			"qWidth": 1,
			"qHeight": 20
		}
	]
}
//Method for reading data from field
const sessionListboxData = await sessionListbox.getListObjectData(sessionListboxDataDef);
//Showing values.
//Here you will find, for each value, the current selection state. For selected value you will find qState: "S".
//Use these selected values for creating your url with selections.
console.log(sessionListboxData[0].qMatrix)
//When you have finished with listbox data, destroy it!!!
await app.destroySessionObject(sessionListbox.id);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Dec 2024 13:27:48 GMT</pubDate>
    <dc:creator>alex_colombo</dc:creator>
    <dc:date>2024-12-10T13:27:48Z</dc:date>
    <item>
      <title>Mashup: Issue with getting all selection options</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Mashup-Issue-with-getting-all-selection-options/m-p/2496188#M21610</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;i am working on Qlik React Mashup. And&amp;nbsp;I am using &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/229862"&gt;@qlik&lt;/a&gt;/api and &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/229862"&gt;@qlik&lt;/a&gt;/embed-react npm package.&lt;BR /&gt;i want to get all selection options. i am using below code to get below field options but it is giving me error "getData is not a function".&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;const&lt;/SPAN&gt; &lt;SPAN&gt;field&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;await&lt;/SPAN&gt; &lt;SPAN&gt;app&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;getField&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Year'&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;const&lt;/SPAN&gt; &lt;SPAN&gt;fieldData&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;await&lt;/SPAN&gt; &lt;SPAN&gt;field&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;getData&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;()&lt;BR /&gt;&lt;BR /&gt;i am getting below object from app.getField&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Anurag2_0-1733391350372.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/175236i7DC23EB4EE438C22/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Anurag2_0-1733391350372.png" alt="Anurag2_0-1733391350372.png" /&gt;&lt;/span&gt;
&lt;P&gt;&lt;SPAN&gt;Can anyone please help me here, how can i get selections options&lt;/SPAN&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 05 Dec 2024 09:37:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Mashup-Issue-with-getting-all-selection-options/m-p/2496188#M21610</guid>
      <dc:creator>Anurag2</dc:creator>
      <dc:date>2024-12-05T09:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: Mashup: Issue with getting all selection options</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Mashup-Issue-with-getting-all-selection-options/m-p/2496577#M21615</link>
      <description>&lt;P&gt;Hey &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/321453"&gt;@Anurag2&lt;/a&gt;&lt;/SPAN&gt; getData method is provided by Capability APIs. Using &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/229862"&gt;@qlik&lt;/a&gt;/api you have to use Engine API methods.&lt;/P&gt;
&lt;P&gt;Not clear your goal. Do you want to perform a select All values in the filed, or get selected values from the field?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2024 15:52:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Mashup-Issue-with-getting-all-selection-options/m-p/2496577#M21615</guid>
      <dc:creator>alex_colombo</dc:creator>
      <dc:date>2024-12-06T15:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: Mashup: Issue with getting all selection options</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Mashup-Issue-with-getting-all-selection-options/m-p/2496801#M21620</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/145804"&gt;@alex_colombo&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;Thanks a lot for replying,&amp;nbsp;&lt;BR /&gt;I am using&amp;nbsp;&lt;STRONG&gt;@qlik/embed-react &lt;/STRONG&gt;and&amp;nbsp;&lt;STRONG&gt;@qlik/api&lt;/STRONG&gt; for react qlik mashup.&lt;BR /&gt;My goal is to get all the selection options in a sheet , (like in year selection if we have 4 options 2020, 2021, 2022, 2023 then i want to get these options).&lt;BR /&gt;&lt;STRONG&gt;For me getData() is undefined&lt;/STRONG&gt;, sharing my code below:&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;const field = await app.getField('Year');&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; const fieldData = await field.getData&lt;/STRONG&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;STRONG&gt;();&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;and i am getting &lt;STRONG&gt;app&lt;/STRONG&gt; using&amp;nbsp; below code :&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;import type { HostConfig } from "@qlik/api/auth";&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;import qix, { type Doc } from "@qlik/api/qix";&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;import { useEffect, useState } from "react";&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;STRONG&gt;export const useApp = (appId: string, hostConfig?: HostConfig) =&amp;gt; {&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; const [app, setApp] = useState&amp;lt;Doc | null&amp;gt;(null);&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; useEffect(() =&amp;gt; {&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; const getApp = async () =&amp;gt; {&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; const session = qix.openAppSession({ appId, hostConfig });&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; const doc = await session.getDoc();&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; setApp(doc);&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; };&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; if (hostConfig) {&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; getApp().catch(console.error); // eslint-disable-line no-console&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; }&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; }, [appId, hostConfig]);&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp; return app;&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;STRONG&gt;};&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;Also i am able to get selected option from below code in&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;qSelectedFieldSelectionInfo key&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;const&lt;/SPAN&gt; &lt;SPAN&gt;currSel&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;await&lt;/SPAN&gt; &lt;SPAN&gt;app&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;getCurrentSelectionObject&lt;/SPAN&gt;&lt;SPAN&gt;();&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;const&lt;/SPAN&gt; &lt;SPAN&gt;currSelLayout&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;await&lt;/SPAN&gt; &lt;SPAN&gt;currSel&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;getLayout&lt;/SPAN&gt;&lt;SPAN&gt;();&lt;BR /&gt;In currSelLayout, i also get&amp;nbsp;qNotSelectedFieldSelectionInfo key but it is coming as blank array.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Please help me here.&lt;BR /&gt;Regards&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 09 Dec 2024 10:18:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Mashup-Issue-with-getting-all-selection-options/m-p/2496801#M21620</guid>
      <dc:creator>Anurag2</dc:creator>
      <dc:date>2024-12-09T10:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: Mashup: Issue with getting all selection options</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Mashup-Issue-with-getting-all-selection-options/m-p/2497095#M21629</link>
      <description>&lt;P&gt;Ok that is clear now. Below code is an example of getting all values from a field. And for doing this we need to create a listbox starting from your field name. If you are able to get current selections fields, then you should create a listbox on top of all of them for getting values.&lt;BR /&gt;This tecquinique is needed because you cannot get more than 6 values from current selections object, and this what happened in the product behind the scenes.&lt;/P&gt;
&lt;P&gt;When you can get values from listbox, using the right sort criteria you will find selected values at the top, and looking at qState prop you can understand if a values is selected (S), optional (O), excluded (X) and so on.&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;import qlikApi from '@qlik/api';
const config = {
	authType: "oauth2",
	host: "_tenant_.eu.qlikcloud.com",
	clientId: "_OAuth_clientId",
	redirectUri: "https://localhost:8080/oauth_callback.html",
	accessTokenStorage: "session"
};

qlikApi.auth.setDefaultHostConfig(config);

// open new app session
const appSession = qlikApi.qix.openAppSession("_appId_");
// get the "qix document (qlik app)"
const app = await appSession.getDoc();
const sessionListboxDef = {
	"qInfo": {
		"qType": "ListObject"
	},
	"qListObjectDef": {
		"qStateName": "$",
		"qLibraryId": "",
		"qDef": {
			"qFieldDefs": [
				"_youtFieldName_"
			],
			"qSortCriterias": [
				{
					"qSortByState": 1
				}
			]
		}
	}
}
const sessionListbox = await app.createSessionObject(sessionListboxDef);
const sessionListboxLayout = await sessionListbox.getLayout();
//Read listbox height
const sessionListboxHeight = sessionListboxLayout.qListObject.qSize.qcy
//We need height for understanding how many values we have. Use this for pagination when need to get all data
const sessionListboxDataDef = {
	"qPath": "/qListObjectDef",
	"qPages": [
		{
			"qLeft": 0,
			"qTop": 0,
			"qWidth": 1,
			"qHeight": 20
		}
	]
}
//Method for reading data from field
const sessionListboxData = await sessionListbox.getListObjectData(sessionListboxDataDef);
//Showing values.
//Here you will find, for each value, the current selection state. For selected value you will find qState: "S".
//Use these selected values for creating your url with selections.
console.log(sessionListboxData[0].qMatrix)
//When you have finished with listbox data, destroy it!!!
await app.destroySessionObject(sessionListbox.id);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2024 13:27:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Mashup-Issue-with-getting-all-selection-options/m-p/2497095#M21629</guid>
      <dc:creator>alex_colombo</dc:creator>
      <dc:date>2024-12-10T13:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Mashup: Issue with getting all selection options</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Mashup-Issue-with-getting-all-selection-options/m-p/2497609#M21635</link>
      <description>&lt;P&gt;It is working. Thanks a lot&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/145804"&gt;@alex_colombo&lt;/a&gt;,&lt;BR /&gt;As i am new to Qlik, And i am working on Qlik React mashup, If possible can you please guide me by sharing some important links which could help me further.&lt;BR /&gt;&lt;BR /&gt;Regards and Thanks again.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 08:55:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Mashup-Issue-with-getting-all-selection-options/m-p/2497609#M21635</guid>
      <dc:creator>Anurag2</dc:creator>
      <dc:date>2024-12-12T08:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: Mashup: Issue with getting all selection options</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Mashup-Issue-with-getting-all-selection-options/m-p/2497690#M21636</link>
      <description>&lt;P&gt;Pretty generic question &lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;, but &lt;A href="https://qlik.dev/" target="_blank"&gt;qlik.dev&lt;/A&gt; site is the place to go where you can find some examples.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 13:49:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Mashup-Issue-with-getting-all-selection-options/m-p/2497690#M21636</guid>
      <dc:creator>alex_colombo</dc:creator>
      <dc:date>2024-12-12T13:49:03Z</dc:date>
    </item>
  </channel>
</rss>

