Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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])
cheers