This content is now out of date.

Visit Our Community

How do I use the user’s login name in a Condition

I am trying to create a View where I want to apply a Condition to the data selected from a Table.
The Condition needs to use the current User's ID, as I want the data returned by the View only to contain records that are directly related to the User, and I do have the User's information in a field in the table I am extracting data from.
So I was hoping for the possibility to have something like:
Create a Dynamic Condition that incorporates " = $USER".
Have looked in vain at results returned by Google, so I am hoping that someone here can provide an answer.
Hello Per,

You can do that with a source filter against the datasource.

When you create the source filter, you can use a SQL Query to populate the list of possible user id's:

select 'USERID', ?USERID?, 'UserId', ?USERID?

This established a source filter with a name of 'UserId' and a value of the current user. Then you can reference that source filter in your view against the table field that contains the UserID.

Here is a link to the wiki that walks you through setting up source filters:

Good luck

Thank you Giovanni,

Per, I hope this answers your question but if not, please let us know.

I have also included the link HERE from our Wiki.

Thank you,