Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
patricesalem
Creator II
Creator II

Get User Name in Qlik Sense - SSO connection

Hello

 

I'm trying to retrieve in my app the user name of the current user.

The OSUser() function only returns the userdirectory and the userid.

Is there a way to retrieve the user name as shown in the QMC (or when logged on the hub - at the top left)

 

thanks for your help

ps: we're working with Qlk enterprise Sept. 2019 Patch 1

 
10 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @varajpmc0816 

There is no function to return UserName directly in Qlik UI. You can obtain User Name from Qlik Sense repository using API. The queries and scripts you can find in built in Monitoring Apps so there is no point for me to replicate it.

Just duplicate the app, search for piece of code you need and thats it. 

In an essence you will need to load user table to your model so it would contain user Id alongside user name and then you can just use Only({<UserId={'$(=SubField(OSUser(), '=', -1))'}>}[User Name])

Lech_Miszkiewicz_0-1714694755202.png

 

cheers

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.