Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
110
Contributor III
Contributor III

qvuser() and osUser() for App data filtering?

So hopefully a quick, two part question   -  it appears qvuser() doesn't return any data on Qlik SaaS , and osUser() only returns the user that reloaded the app.

I was hoping to be able to retrieve the currently logged in user viewing the app - in order to allow that user to automatically filter their data with a button action.

So   - is there a plan to make a 'live' user function, so when referenced, it's aware of who is logged in ( similar to section access )  - or is there another function I'm not aware of to attain this info?


Labels (1)
  • SaaS

1 Solution

Accepted Solutions
MatheusC
Specialist
Specialist

@110  OSUser() will return the currently connected user. See the documentation below from Qlik Help.

https://help.qlik.com/en-US/sense/May2024/Subsystems/Hub/Content/Sense_Hub/Scripting/SystemFunctions...

MatheusC_0-1722005728663.png

 

You can use the expression below, which will evaluate and extract the user, then apply your filter condition:

=SubField(OSUser(), '=', -1)

As informed @eike_s  by the configuration, it can return either the IDP or the email.

- Matheus

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!

View solution in original post

3 Replies
eike_s
Partner - Contributor III
Partner - Contributor III

In the Qlik Cloud, the OSUSER() function outputs the ‘Idp subject’ of the current user under userid. Depending on how and what kind of IdP is configured, the corresponding value is returned.

MatheusC
Specialist
Specialist

@110  OSUser() will return the currently connected user. See the documentation below from Qlik Help.

https://help.qlik.com/en-US/sense/May2024/Subsystems/Hub/Content/Sense_Hub/Scripting/SystemFunctions...

MatheusC_0-1722005728663.png

 

You can use the expression below, which will evaluate and extract the user, then apply your filter condition:

=SubField(OSUser(), '=', -1)

As informed @eike_s  by the configuration, it can return either the IDP or the email.

- Matheus

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!
110
Contributor III
Contributor III
Author

Thanks @MatheusC  & @eike_s   -  
I was trying to be smart by encapsulating the logic into a variable to make it easier to use.- what was odd, was under some visualizations referencing via the variable - presume had the original calculated value of the variable from the load and not the 'live' one.

AS @MatheusC  suggested,  doing the subfield 'live'  - without using variables works and works in some tests with other users. 


='You are logged in as : ' & vEmailLoggedInUser & ' Associated Site :' & only(if(KeyEmailMatchUpper = trim(upper(SubField(osuser(),'UserId=',2))),OfficeName))