<?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: Qlik Sense Engine API - restoring a selection state is not working in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Engine-API-restoring-a-selection-state-is-not-working/m-p/1847338#M15736</link>
    <description>&lt;P&gt;I don't think you have misunderstood those methods, but they only work with QCS. That functionality is not available in QSEfW. However, I see there is no mention of this in the documentation of the method which should be considered a documentation error I guess...&lt;/P&gt;</description>
    <pubDate>Fri, 15 Oct 2021 09:42:36 GMT</pubDate>
    <dc:creator>Øystein_Kolsrud</dc:creator>
    <dc:date>2021-10-15T09:42:36Z</dc:date>
    <item>
      <title>Qlik Sense Engine API - restoring a selection state is not working</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Engine-API-restoring-a-selection-state-is-not-working/m-p/1846850#M15731</link>
      <description>&lt;P&gt;Hello qlikers&lt;/P&gt;&lt;P&gt;I'm developing an app that uses the Qlik Sense Engine API (via the .NET SDK) to interact with a qlik sense app.&lt;/P&gt;&lt;P&gt;In the app, I need to make a series of selections, that I later have to revert. To do this, I thought I could use the&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/sense-developer/May2021/Subsystems/NetSDKAPIref/Content/Qlik.Engine.App.StoreTempSelectionState.htm" target="_self"&gt;StoreTempSelectionState&lt;/A&gt; and&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/sense-developer/May2021/Subsystems/NetSDKAPIref/Content/Qlik.Engine.App.RestoreTempSelectionState.htm" target="_self"&gt;RestoreTempSelectionState&lt;/A&gt; methods, as I assumed by the name that they would allow me to save and then recall the state of the app's selections.&lt;/P&gt;&lt;P&gt;However, after testing it, it appears I'm either wrong or doing something incorrect, because the Restore method seems to do absolutely nothing. Here's the code I'm using:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var state = app.StoreTempSelectionState();

app.GetField("foo").Select("...");
app.GetField("bar").Select("...");
//etc.

app.RestoreTempSelectionState(state.Id);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did I misunderstand what those methods do? Is there a proper way to do this?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 23:37:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Engine-API-restoring-a-selection-state-is-not-working/m-p/1846850#M15731</guid>
      <dc:creator>master_t</dc:creator>
      <dc:date>2024-11-15T23:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense Engine API - restoring a selection state is not working</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Engine-API-restoring-a-selection-state-is-not-working/m-p/1847338#M15736</link>
      <description>&lt;P&gt;I don't think you have misunderstood those methods, but they only work with QCS. That functionality is not available in QSEfW. However, I see there is no mention of this in the documentation of the method which should be considered a documentation error I guess...&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 09:42:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Engine-API-restoring-a-selection-state-is-not-working/m-p/1847338#M15736</guid>
      <dc:creator>Øystein_Kolsrud</dc:creator>
      <dc:date>2021-10-15T09:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense Engine API - restoring a selection state is not working</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Engine-API-restoring-a-selection-state-is-not-working/m-p/1847352#M15737</link>
      <description>&lt;P&gt;Thanks for the explanation... do you think there's an alternative way of doing it that works on both QSE and QCS?&lt;/P&gt;&lt;P&gt;At the moment as a workaround I am manually reading all the selections on all the fields and then manually restoring them, but it seems like a bit of a hack to me.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 09:57:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Engine-API-restoring-a-selection-state-is-not-working/m-p/1847352#M15737</guid>
      <dc:creator>master_t</dc:creator>
      <dc:date>2021-10-15T09:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense Engine API - restoring a selection state is not working</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Engine-API-restoring-a-selection-state-is-not-working/m-p/1847371#M15738</link>
      <description>&lt;P&gt;Think that are some options for you but I don't know which is the best:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Try the&amp;nbsp;&lt;A href="https://qlik.dev/apis/json-rpc/qix/doc#%23%2Fentries%2FDoc%2Fentries%2FBack" target="_blank"&gt;https://qlik.dev/apis/json-rpc/qix/doc#%23%2Fentries%2FDoc%2Fentries%2FBack&lt;/A&gt;&amp;nbsp;for going back in the "selection stack"&lt;/P&gt;&lt;P&gt;- Create a bookmark&amp;nbsp;&lt;A href="https://qlik.dev/apis/json-rpc/qix/doc#%23%2Fentries%2FDoc%2Fentries%2FCreateBookmarkEx" target="_blank"&gt;https://qlik.dev/apis/json-rpc/qix/doc#%23%2Fentries%2FDoc%2Fentries%2FCreateBookmarkEx&lt;/A&gt;&amp;nbsp;that you apply when you want to reset the selections&lt;/P&gt;&lt;P&gt;- Do your selections in an alternate state&amp;nbsp;&lt;A href="https://qlik.dev/apis/json-rpc/qix/doc#%23%2Fentries%2FDoc%2Fentries%2FAddSessionAlternateState" target="_blank"&gt;https://qlik.dev/apis/json-rpc/qix/doc#%23%2Fentries%2FDoc%2Fentries%2FAddSessionAlternateState&lt;/A&gt;&amp;nbsp;when you want to go back change back the state&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 10:20:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Engine-API-restoring-a-selection-state-is-not-working/m-p/1847371#M15738</guid>
      <dc:creator>han</dc:creator>
      <dc:date>2021-10-15T10:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense Engine API - restoring a selection state is not working</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Engine-API-restoring-a-selection-state-is-not-working/m-p/1847497#M15739</link>
      <description>&lt;P&gt;Thanks for your suggestions.&lt;/P&gt;&lt;P&gt;I'm trying the bookmarks route, it seems to work to some extent, but I have a questions if you dont' mind.&lt;/P&gt;&lt;P&gt;I've written the following code:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var bookmark = app.CreateGenericBookmark(new GenericBookmarkProperties()
{
    Info = new NxInfo() { Type = "bookmark", Id = Guid.NewGuid().ToString() }
});

app.GetField("foo").Select("...");
app.GetField("bar").Select("...");
//etc.

app.ApplyGenericBookmark(bookmark.Info.Id); //seems to work correctly, selections are restored
app.DestroyGenericBookmark(bookmark.Info.Id); //throws ArgumentNullException&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It mostly works, until the last instruction (calling DestroyGenericBookmark) that throws a ArgumentNullException:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"Value cannot be null. Parameter name: key"
  at Qlik.Engine.Communication.QlikConnection.AwaitResponseTask[T](T task, String methodName, CancellationToken cancellationToken)
   at Qlik.Engine.Communication.QlikConnection.AwaitResponse[T](Task`1 task, String methodName, CancellationToken cancellationToken)
   at Qlik.Engine.App.DestroyGenericBookmark(String id)&lt;/LI-CODE&gt;&lt;P&gt;Can anyone tell me why this happens? My program needs to run every day on several qlik apps, I don't want to fill them with unused "ghost" bookmarks...&lt;/P&gt;&lt;P&gt;PS: yes, I've checked, I'm not passing a null ID to the method, I'm passing the correct ID, the problem is somewhere else...&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 14:34:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Engine-API-restoring-a-selection-state-is-not-working/m-p/1847497#M15739</guid>
      <dc:creator>master_t</dc:creator>
      <dc:date>2021-10-15T14:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense Engine API - restoring a selection state is not working</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Engine-API-restoring-a-selection-state-is-not-working/m-p/1847909#M15742</link>
      <description>&lt;P&gt;Wow... You've found a bug that from what I can see is pretty much as old as the SDK itself! So you now have the honor of holding the title of the finder of the oldest SDK bug ever recorded &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; It goes back at least to v3.0 which was the oldest one I could test without too much effort, but I suspect this goes all the way back to 1.0.&lt;/P&gt;&lt;P&gt;The call to DestroyGenericBookmark will correctly clear the bookmark from the engine so you won't suffer any "ghost" bookmarks. It's when the response to DestroyGenericBookmark is interpreted that the error is thrown. A workaround (apart from a try/catch) is to use the CreateBookmark method from the client namespace instead of CreateGenericBookmark from the engine namespace.&lt;/P&gt;&lt;P&gt;The problem stems from how the result of CreateGenericBookmark is deserialized, and affects all creation methods that returns a result structure instead of a single return value. So other examples of endpoints affected by this are:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;CreateGenericObject&lt;/LI&gt;&lt;LI&gt;CreateGenericMeasure&lt;/LI&gt;&lt;LI&gt;CreateGenericDimension&lt;/LI&gt;&lt;LI&gt;CreateVariableEx&lt;/LI&gt;&lt;LI&gt;CreateBookmarkEx&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;However, the method CreateGenericSessionObject is NOT affected by this problem as it returns a single ObjectInterface value instead of a struct. The reason why the CreateBookmark from the client namespace does not suffer from the problem is simply that it deserializes the response from the engine sligthly differently from the corresponding engine namespace method.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Oct 2021 08:11:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Engine-API-restoring-a-selection-state-is-not-working/m-p/1847909#M15742</guid>
      <dc:creator>Øystein_Kolsrud</dc:creator>
      <dc:date>2021-10-18T08:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense Engine API - restoring a selection state is not working</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Engine-API-restoring-a-selection-state-is-not-working/m-p/1847915#M15743</link>
      <description>&lt;P&gt;Happy to help &lt;span class="lia-unicode-emoji" title=":rolling_on_the_floor_laughing:"&gt;🤣&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks for the pointers, I'll just wrap the call in a try/catch until a bugfix is released&lt;/P&gt;</description>
      <pubDate>Mon, 18 Oct 2021 08:18:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Engine-API-restoring-a-selection-state-is-not-working/m-p/1847915#M15743</guid>
      <dc:creator>master_t</dc:creator>
      <dc:date>2021-10-18T08:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense Engine API - restoring a selection state is not working</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Engine-API-restoring-a-selection-state-is-not-working/m-p/1848994#M15760</link>
      <description>&lt;P&gt;Some further info on this for anyone facing the same issue:&lt;/P&gt;
&lt;P&gt;Wrapping the call in try/catch is not a viable solution, because when the&amp;nbsp;ArgumentNullException is thrown the IApp object gets automatically disposed and is no longer in a usable state.&lt;/P&gt;
&lt;P&gt;Using the deprecated CreateBookmark() method seems to work better.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 15:33:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Engine-API-restoring-a-selection-state-is-not-working/m-p/1848994#M15760</guid>
      <dc:creator>master_t</dc:creator>
      <dc:date>2021-10-19T15:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense Engine API - restoring a selection state is not working</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Engine-API-restoring-a-selection-state-is-not-working/m-p/1849391#M15763</link>
      <description>&lt;P&gt;Ouch! Well, v15.5.1 was just released which contains a fix for that null-value issue.&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.nuget.org/packages/QlikSense.NetSDK/15.5.1" target="_blank" rel="noopener"&gt;https://www.nuget.org/packages/QlikSense.NetSDK/15.5.1&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 11:51:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Engine-API-restoring-a-selection-state-is-not-working/m-p/1849391#M15763</guid>
      <dc:creator>Øystein_Kolsrud</dc:creator>
      <dc:date>2021-10-20T11:51:59Z</dc:date>
    </item>
  </channel>
</rss>

