Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Retrieve current user

Hi all,

I have a configuration where users are logging in by using an accespoint. The users are managed in a custom directory.

In the dashboards I want to have the log in-name of the active user available. There is no section access implemented (I am using publisher for reduced documents). I have tried qvuser () and osuser (), but neither of them lead to required results. 

Does anyone know of an alternative command or approach?

Thanks

Regards Remco

1 Solution

Accepted Solutions
ashfaq_haseeb
Champion III
Champion III

Hi,

I personally tries this. It worked for me without any go with osuser()

osuser ()  Returns the custom user.


If not share a sample to check with.


Regards

ASHFAQ

View solution in original post

6 Replies
jduenyas
Specialist
Specialist

In the VB Edit section enter this Macro

Public Function CurrentUser()

          Set objNetWork = CreateObject("Wscript.Network")

          CurrentUser = objNetwork.UserName

          msgbox CurrentUser

End Function

You can then assign this value to a variable and use it throughout

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

qvuser () and osuser () should give you the correct results. Could you describe what output you are getting from those functions and what output you would like?


-Rob

Not applicable
Author

Hi Rob,

Thanks for your reply.

The strange thing is that both commands have no result: an empty string. What I want to see is the userID of the user that is using that application.

Regards Remco

ashfaq_haseeb
Champion III
Champion III

Hi,

I personally tries this. It worked for me without any go with osuser()

osuser ()  Returns the custom user.


If not share a sample to check with.


Regards

ASHFAQ

Not applicable
Author

hey remco,

qvuser() will only work if section access has been applied. the osuser() should work.i tried it on my app and it worked.

maybe, if you could share your application and let everyone check.

cheers

kunal bhattacharjee

Not applicable
Author

Thanks all for your input. In the end OSUSER() [without typos.....] did the trick. This included the domain, but with some manipulation I created the string I wanted to have.

Cheers, Remco