cancel
Showing results for 
Search instead for 
Did you mean: 

current user session

dansmith
Confirmed Champ
Confirmed Champ

Is there "built in" functionality to supply the current user session as an element to restrict a query? So, for example, report only shows work assigned to me without having to select userid/username? Something similar to the macros in workview; ~username. 

3 REPLIES 3

William_Pawul1
Star Contributor
Star Contributor

Hi Dan!

Reporting Dashboards supports the use of macros in Custom SQL Query data providers, including the ability to return the current User ID that is executing the query.  You can find all of the macros available, along with how to format them within your data provider, in the Reporting Dashboards MRG.

Have a great day!

Hannah_Nelson
Champ on-the-rise
Champ on-the-rise
Hi Dan, did you ever find out if there was a way to limit the information in a reporting dashboard to the current user session? I looked through the macros, and I don't think they will do that. I want to create a dashboard that allows the user logged in to return items for just them and not the whole team.

Luke_Freeman
Confirmed Champ
Confirmed Champ
Hi Hannah,
Here's an example a simple SQL based Data Provider to retrieve the current user using one of the standard macros. I'm using this to create a "My Dashboard" using Cross-Data-Source filtering to only show the user's records:
select usernum, RTrim(username) username, realname
from hsi.useraccount
where usernum = ##OB_CURRENTUSER_ID

Let me know if you have any questions.
Thanks
Luke