Forum Discussion
gatapia
10 years agoFrequent Visitor
How to access context information inside a custom visual
I am building a custom visual that needs to know information about the report it is hosted in and its state. For instance I need the following: - Username of the current user running the report - T...
itayrom
10 years agoResolver II
Regerding the first matter, the info you are asking for is accesible via the userInfo object in the powerbi.session module(powerbi.session.userInfo). It has properties that provide you with the current user's username, given name, surname, etc...
As for the other two, I'm yet to find a way to get that information. I don't think there's an interface for it, though I wouldn't mind being corrected.
zdralic
4 years agoFrequent Visitor
Hello itayrom,
How do I access the powerbi.session.userInfo from my visual.ts? And do you know if it's reliable to use?
In my organization, we want different filters applied based on the current user viewing the report, and therefore I also need the email.
Thanks,
Regards