34
Views
3
Comments
Solved
Microsoft LDAP AD Identity UserId or Email are always the same

Hello,
can I have some with getting the email of the currently logged in user?
I'm using a Microsoft AD as login provider. On the menu the value "Username" is hard-coded. I need to display my user's email in there. When I go to expression and GetUsers.List.Current.User.Username I'm always getting the same email (first one). Am I doing something wrong ?

Thanks in advance!

UserImage.jpg
Aleksis Sideris
Solution

I found a way meanwhile yesterday. I am using 

GetUserById.List.Current.User.Username

and it works.

Thanks for the answers :)) 


2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Aleksis,

That's difficult to say, since I don't know what you put into "GetUsers" (which I assume is an Aggregate somewhere?). It's also a bit suspect it's called "GetUsers" (plural), as I would expect a GetUser (singular) if the Aggregate retrieves a single user (the currently logged-on one).

2025-09-16 17-12-57
João Mateus

Hi,

I guess you are retrieving all Users in your query and the Email being shown is of the first user (GetUsers.List.Current.User).

You need to filter the Aggregate. For this add the following filter: User.Id = GetUserId()

The GetUserId() is a builtin function that retrieves the UserId of the logged in User. If you filter the Users table with this Id, you will get the information for the current User.

Cheers,

João

UserImage.jpg
Aleksis Sideris
Solution

I found a way meanwhile yesterday. I am using 

GetUserById.List.Current.User.Username

and it works.

Thanks for the answers :)) 


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.