<?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 Keeping selections in lists that use the same field but different expressions in sync in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Keeping-selections-in-lists-that-use-the-same-field-but/m-p/1265118#M6933</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So say I create 2 lists, each using a different expression, as below &lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_148061644843438 jive_text_macro" jivemacro_uid="_148061644843438" modifiedtitle="true"&gt;
&lt;P&gt;app.createList({&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "qDef": {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "qFieldDefs": ["=if([Name]='NameOfProduct', [Tags])"],&lt;/P&gt;
&lt;P&gt;&amp;nbsp; },&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "qShowAlternatives": true,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "qInitialDataFetch": [{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "qHeight": 1000,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "qWidth": 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }]&lt;/P&gt;
&lt;P&gt;});&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt;"&gt;app.createList({&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "qDef": {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "qFieldDefs": ["=if([Product Type]='TypeOfProduct', [Tags])"],&lt;/P&gt;
&lt;P&gt;&amp;nbsp; },&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "qShowAlternatives": true,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "qInitialDataFetch": [{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "qHeight": 1000,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "qWidth": 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }]&lt;/P&gt;
&lt;P&gt;});&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I then make selections using the Field API on the "Tags" field, the above lists will get excluded values, but not selected, alternate, or selected-excluded values since they are seen by the engine as a different field than the "Tags" field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know I can select within the model of each object itself with a bit of help from the Engine API, so I tried that&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14806170968997007" jivemacro_uid="_14806170968997007" modifiedtitle="true"&gt;
&lt;P&gt;app.createList({&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "qDef": {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "qFieldDefs": ["=if([Name]='NameOfProduct', [Tags])"],&lt;/P&gt;
&lt;P&gt;&amp;nbsp; },&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "qShowAlternatives": true,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "qInitialDataFetch": [{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "qHeight": 1000,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "qWidth": 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }]&lt;/P&gt;
&lt;P&gt;}).then(function(model) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; var msg = {"method":"SelectListObjectValues","handle":model.handle,"params":["/qListObjectDef",[0],true], "jsonrpc":"2.0"}&lt;/P&gt;
&lt;P&gt;&amp;nbsp; model.session.rpc(msg);&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt;"&gt;});&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt;"&gt;app.createList({&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "qDef": {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "qFieldDefs": ["=if([Product Type]='TypeOfProduct', [Tags])"],&lt;/P&gt;
&lt;P&gt;&amp;nbsp; },&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "qShowAlternatives": true,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "qInitialDataFetch": [{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "qHeight": 1000,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "qWidth": 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }]&lt;/P&gt;
&lt;P&gt;})&lt;SPAN style="font-size: 9pt;"&gt;.then(function(model) {&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; var msg = {"method":"SelectListObjectValues","handle":model.handle,"params":["/qListObjectDef",[0],true], "jsonrpc":"2.0"}&lt;/P&gt;
&lt;P&gt;&amp;nbsp; model.session.rpc(msg);&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt;"&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;And this works fine. It will select the element with element number equal to 0 in each list, and the lists will represent state correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is, I need to keep these two lists in sync. Meaning, if theres a tag called "Electronics" and I select that tag from the UI of either of these lists, then I need that selection to be made in both lists. But I can't simply select on the field, because the lists won't have the right states, and the element numbers are different for each list, so the element number for "Electronics", for instance, would be different in each list, so I can't simply have one method that selects on both models the same element number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have any idea how I could meet the requirements of being able to have two different lists like above, both based on the same field, but using different expressions to limit that field, and having selections in either list update the states correctly for both lists?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Dec 2016 18:39:06 GMT</pubDate>
    <dc:creator>Francis_Kabinoff</dc:creator>
    <dc:date>2016-12-01T18:39:06Z</dc:date>
    <item>
      <title>Keeping selections in lists that use the same field but different expressions in sync</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Keeping-selections-in-lists-that-use-the-same-field-but/m-p/1265118#M6933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So say I create 2 lists, each using a different expression, as below &lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_148061644843438 jive_text_macro" jivemacro_uid="_148061644843438" modifiedtitle="true"&gt;
&lt;P&gt;app.createList({&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "qDef": {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "qFieldDefs": ["=if([Name]='NameOfProduct', [Tags])"],&lt;/P&gt;
&lt;P&gt;&amp;nbsp; },&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "qShowAlternatives": true,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "qInitialDataFetch": [{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "qHeight": 1000,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "qWidth": 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }]&lt;/P&gt;
&lt;P&gt;});&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt;"&gt;app.createList({&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "qDef": {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "qFieldDefs": ["=if([Product Type]='TypeOfProduct', [Tags])"],&lt;/P&gt;
&lt;P&gt;&amp;nbsp; },&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "qShowAlternatives": true,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "qInitialDataFetch": [{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "qHeight": 1000,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "qWidth": 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }]&lt;/P&gt;
&lt;P&gt;});&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I then make selections using the Field API on the "Tags" field, the above lists will get excluded values, but not selected, alternate, or selected-excluded values since they are seen by the engine as a different field than the "Tags" field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know I can select within the model of each object itself with a bit of help from the Engine API, so I tried that&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14806170968997007" jivemacro_uid="_14806170968997007" modifiedtitle="true"&gt;
&lt;P&gt;app.createList({&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "qDef": {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "qFieldDefs": ["=if([Name]='NameOfProduct', [Tags])"],&lt;/P&gt;
&lt;P&gt;&amp;nbsp; },&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "qShowAlternatives": true,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "qInitialDataFetch": [{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "qHeight": 1000,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "qWidth": 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }]&lt;/P&gt;
&lt;P&gt;}).then(function(model) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; var msg = {"method":"SelectListObjectValues","handle":model.handle,"params":["/qListObjectDef",[0],true], "jsonrpc":"2.0"}&lt;/P&gt;
&lt;P&gt;&amp;nbsp; model.session.rpc(msg);&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt;"&gt;});&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt;"&gt;app.createList({&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "qDef": {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "qFieldDefs": ["=if([Product Type]='TypeOfProduct', [Tags])"],&lt;/P&gt;
&lt;P&gt;&amp;nbsp; },&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "qShowAlternatives": true,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "qInitialDataFetch": [{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "qHeight": 1000,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "qWidth": 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }]&lt;/P&gt;
&lt;P&gt;})&lt;SPAN style="font-size: 9pt;"&gt;.then(function(model) {&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; var msg = {"method":"SelectListObjectValues","handle":model.handle,"params":["/qListObjectDef",[0],true], "jsonrpc":"2.0"}&lt;/P&gt;
&lt;P&gt;&amp;nbsp; model.session.rpc(msg);&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt;"&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;And this works fine. It will select the element with element number equal to 0 in each list, and the lists will represent state correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is, I need to keep these two lists in sync. Meaning, if theres a tag called "Electronics" and I select that tag from the UI of either of these lists, then I need that selection to be made in both lists. But I can't simply select on the field, because the lists won't have the right states, and the element numbers are different for each list, so the element number for "Electronics", for instance, would be different in each list, so I can't simply have one method that selects on both models the same element number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have any idea how I could meet the requirements of being able to have two different lists like above, both based on the same field, but using different expressions to limit that field, and having selections in either list update the states correctly for both lists?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2016 18:39:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Keeping-selections-in-lists-that-use-the-same-field-but/m-p/1265118#M6933</guid>
      <dc:creator>Francis_Kabinoff</dc:creator>
      <dc:date>2016-12-01T18:39:06Z</dc:date>
    </item>
  </channel>
</rss>

