<?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: DocumentName() provide SessionApp_ Id in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/DocumentName-provide-SessionApp-Id/m-p/1958817#M79036</link>
    <description>&lt;P&gt;Any news on this topic? We are facing the same issue and would be thankful for help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jul 2022 10:34:23 GMT</pubDate>
    <dc:creator>SimonInc</dc:creator>
    <dc:date>2022-07-21T10:34:23Z</dc:date>
    <item>
      <title>DocumentName() provide SessionApp_ Id</title>
      <link>https://community.qlik.com/t5/App-Development/DocumentName-provide-SessionApp-Id/m-p/1577273#M42058</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;i have a problem with the DocumentName() result saved to a variable. It should save the App Id and if i log it with Trace i does, but when i save the variable to a table or use it in a REST-Query, the value always appear as SessionApp_&amp;lt;SessionID&amp;gt;.&lt;/P&gt;&lt;P&gt;I followed the guide of&amp;nbsp;&lt;A title="How to access QRS (Repository) from Load Script" href="https://community.qlik.com/t5/Qlik-Sense-Enterprise-Documents/How-to-access-QRS-Repository-from-Load-Script/ta-p/1484264" target="_blank" rel="noopener"&gt;How to access QRS (Repository) from Load Script&lt;/A&gt;. The reason i need to do this, is that i need the custom properties (maybe some additional data) for each app, which can contain the same name.&lt;BR /&gt;&lt;BR /&gt;In addition i did some testing for the problem and find:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;First try to declare the variable like the code below:&lt;BR /&gt;Table tmp will contain SessionApp_&amp;lt;SessionId&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;LI&gt;Second try:&lt;BR /&gt;I reload the script. Still&amp;nbsp;SessionApp_&amp;lt;SessionId&amp;gt; in table tmp.&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;LI&gt;Third try:&lt;BR /&gt;I delete "LET vAppId = DocumentName()" and reload the script. Now table tmp will contain the App Id.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Code Snippet:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LET vAppId = DocumentName();&lt;BR /&gt;tmp:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Load * Inline [&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AppId&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $(vAppId)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your see, the problem is that DocumentName() should be in a script which will be included. That means the AppId shall be determined automatically. Does anyone has a solution for this issue or know why this is happening?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit:&lt;BR /&gt;I attached a picture to show the results.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 20:55:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/DocumentName-provide-SessionApp-Id/m-p/1577273#M42058</guid>
      <dc:creator>Tos</dc:creator>
      <dc:date>2024-11-16T20:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: DocumentName() provide SessionApp_ Id</title>
      <link>https://community.qlik.com/t5/App-Development/DocumentName-provide-SessionApp-Id/m-p/1958817#M79036</link>
      <description>&lt;P&gt;Any news on this topic? We are facing the same issue and would be thankful for help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 10:34:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/DocumentName-provide-SessionApp-Id/m-p/1958817#M79036</guid>
      <dc:creator>SimonInc</dc:creator>
      <dc:date>2022-07-21T10:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: DocumentName() provide SessionApp_ Id</title>
      <link>https://community.qlik.com/t5/App-Development/DocumentName-provide-SessionApp-Id/m-p/1958836#M79037</link>
      <description>&lt;P&gt;I have done a workaround in this, just to store the appid information.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Let appId = DocumentName();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I connect via REST to the qlik sense repository which let you generate something like this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;RestConnectorMasterTable:&lt;BR /&gt;SQL SELECT &lt;BR /&gt;"id" AS "id_u1",&lt;BR /&gt;"name" AS "name_u1",&lt;BR /&gt;"__KEY_root",&lt;BR /&gt;(SELECT &lt;BR /&gt;"id" AS "id_u0",&lt;BR /&gt;"__FK_stream"&lt;BR /&gt;FROM "stream" FK "__FK_stream")&lt;BR /&gt;FROM JSON (wrap on) "root" PK "__KEY_root";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the next step i use this table and rebuild with joins. In the start table i use the appId variable to restrict the results to my app.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;app:&lt;BR /&gt;Load &lt;BR /&gt;[id_u1] as appId,&lt;BR /&gt;[name_u1] as appName,&lt;BR /&gt;[__KEY_root] as appKey&lt;BR /&gt;Resident RestConnectorMasterTable&lt;BR /&gt;Where Not IsNull([__KEY_root]) And [id_u1]='$(appId)';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After that you have stored the correct app id within a table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 11:19:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/DocumentName-provide-SessionApp-Id/m-p/1958836#M79037</guid>
      <dc:creator>Tos</dc:creator>
      <dc:date>2022-07-21T11:19:35Z</dc:date>
    </item>
  </channel>
</rss>

