<?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 SaaS - Display user name in an app in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Qlik-SaaS-Display-user-name-in-an-app/m-p/1904332#M74572</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/127395"&gt;@Qlikstu&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;refer below community post:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/New-to-Qlik-Sense/Get-User-Name-in-Qlik-Sense-SSO-connection/td-p/1660327" target="_blank"&gt;https://community.qlik.com/t5/New-to-Qlik-Sense/Get-User-Name-in-Qlik-Sense-SSO-connection/td-p/1660327&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Aditya&lt;/P&gt;</description>
    <pubDate>Sat, 12 Mar 2022 09:26:59 GMT</pubDate>
    <dc:creator>Aditya_Chitale</dc:creator>
    <dc:date>2022-03-12T09:26:59Z</dc:date>
    <item>
      <title>Qlik SaaS - Display user name in an app</title>
      <link>https://community.qlik.com/t5/App-Development/Qlik-SaaS-Display-user-name-in-an-app/m-p/1904050#M74564</link>
      <description>&lt;P&gt;HI Everyone&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In Qlik SaaS does anyone have any idea how I can display the name of the user in Qlik SaaS. I'm creating a welcome screen in-app and want their first name (ideally).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried setting a variable LET vUser = OsUser; but this just return the user ID rather than the name.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can someone offer some help on this?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Stuart&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 11:55:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Qlik-SaaS-Display-user-name-in-an-app/m-p/1904050#M74564</guid>
      <dc:creator>Qlikstu</dc:creator>
      <dc:date>2022-03-11T11:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik SaaS - Display user name in an app</title>
      <link>https://community.qlik.com/t5/App-Development/Qlik-SaaS-Display-user-name-in-an-app/m-p/1904332#M74572</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/127395"&gt;@Qlikstu&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;refer below community post:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/New-to-Qlik-Sense/Get-User-Name-in-Qlik-Sense-SSO-connection/td-p/1660327" target="_blank"&gt;https://community.qlik.com/t5/New-to-Qlik-Sense/Get-User-Name-in-Qlik-Sense-SSO-connection/td-p/1660327&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Aditya&lt;/P&gt;</description>
      <pubDate>Sat, 12 Mar 2022 09:26:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Qlik-SaaS-Display-user-name-in-an-app/m-p/1904332#M74572</guid>
      <dc:creator>Aditya_Chitale</dc:creator>
      <dc:date>2022-03-12T09:26:59Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik SaaS - Display user name in an app</title>
      <link>https://community.qlik.com/t5/App-Development/Qlik-SaaS-Display-user-name-in-an-app/m-p/2490651#M101970</link>
      <description>&lt;P&gt;If &lt;STRONG&gt;OSUser()&lt;/STRONG&gt; is returning you a value like&lt;/P&gt;
&lt;P&gt;UserDirectory=; UserId=auth0|a08D000001BZigbIAD&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is an easy way to convert that into a User Name using the REST API for USERS (which returns all users):&lt;/P&gt;
&lt;P&gt;&lt;A href="https://qlik.dev/apis/rest/users/" target="_blank"&gt;https://qlik.dev/apis/rest/users/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Notice the the value returned from OSUser() is actually the SUBJECT for my user id, and is NOT the ID itself. Knowing that is important, below the image I will show you how to parse out JUST that auth0.... part of what OSUser() returns and then how to fire the API to get the name.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DaltonUserID.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/173765iA367E142FE3453F5/image-size/large?v=v2&amp;amp;px=999" role="button" title="DaltonUserID.png" alt="DaltonUserID.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You can easily parse out the needed SUBJECT with a command like this:&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;STRONG&gt;Let vSubject = SubField(SubField(OSUser(),';',2),'=',2) ;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Since the User API call I mentioned above will return all Users we would really like to give it a "where" clause saying "I want the user(s) where the subject = ...". Just like this:&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;STRONG&gt;&lt;A href="https://partner-engineering-saas.us.qlikcloud.com/api/v1/users?subject=auth0|" target="_blank"&gt;https://partner-engineering-saas.us.qlikcloud.com/api/v1/users?subject=auth0|&lt;/A&gt;a08D000001BZigbIAD&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Yeah I can make that work manually, but how can I make that work inside of my Qlik Sense Cloud application? You really need a 2 step process for that:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Step 1: When you define the REST API connector you need to ensure that you check the Allow "WITH CONNECTION" button near the bottom of the configuration.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="AllowWithConnection.png" style="width: 251px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/173769iC972AAE64F0731B6/image-size/large?v=v2&amp;amp;px=999" role="button" title="AllowWithConnection.png" alt="AllowWithConnection.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;After that you can still call the API ... but now you have the option of providing it a different URL, one that is calculated on the fly ... so let's calculate it. Above we set the variable for the Subject, now we can use it:&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;STRONG&gt;&lt;SPAN&gt;Let vProjectInformationURL = '&lt;A href="https://partner-engineering-saas.us.qlikcloud.com/api/v1/users?subject=$(vSubject" target="_blank"&gt;https://partner-engineering-saas.us.qlikcloud.com/api/v1/users?subject=$(vSubject&lt;/A&gt;)';&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Essentially recreating the correct URL via code. Now when we call the connection we can say "that URL I gave you to create the connector is old news, please use the URL I just defined for you instead:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="ConnectionWith.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/173772iD54A934BC745D43A/image-size/large?v=v2&amp;amp;px=999" role="button" title="ConnectionWith.png" alt="ConnectionWith.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;The API will be called as you requested so that only your desired SUBJECT is returned, and then it's just a matter of using the PEEK function to pull out the email/name or whatever you want:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV class="lia-indent-padding-left-30px"&gt;[User]:&lt;/DIV&gt;
&lt;DIV class="lia-indent-padding-left-30px"&gt;LOAD&lt;/DIV&gt;
&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt; [name_u2] AS [User Name],&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt; [email] as [User Email]&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="lia-indent-padding-left-30px"&gt;RESIDENT RestConnectorMasterTable&lt;/DIV&gt;
&lt;DIV class="lia-indent-padding-left-30px"&gt;WHERE NOT IsNull([__FK_data]);&lt;/DIV&gt;
&lt;DIV class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;STRONG&gt;Let vUserName = Peek('User Name', 0, 'User');&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;STRONG&gt;Let vUserEmail = Peek('User Email', 0, 'User');&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2024 18:14:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Qlik-SaaS-Display-user-name-in-an-app/m-p/2490651#M101970</guid>
      <dc:creator>Dalton_Ruer</dc:creator>
      <dc:date>2024-11-04T18:14:21Z</dc:date>
    </item>
  </channel>
</rss>

