4152
Views
6
Comments
Solved
Use GetUserId to get the user_name corresponding to the GetUserId
Question

Hello guys

I am struggling to get the name attribute from User entity using GetUserId,

anyone peeps to help me get this challenge correct...I don't want to display the current logged in userId but I need to display the current user_name that is associated with the current UserId

2025-01-07 17-06-54
Paulo Cação
Champion
Solution

Hi siseko,

Try something like that:

GetUser(GetUserId()).User.Name

Regards!

2024-06-18 11-24-32
Siseko Thethi

Paulo Cação wrote:

Hi siseko,

Try something like that:

GetUser(GetUserId()).User.Name

Regards!

Hello Paulo,

I don't get it right,I have been trying to use the method you gave me.

Thanks so much


2025-01-07 17-06-54
Paulo Cação
Champion

Hi,

Where are you trying to show the user name? If you try to put in an expression, you will see it. (if you have a logged in)

Regards!

2023-04-06 11-24-23
Paulo Zacarias

Hello Siseko, 

I'll assume that you are using the Users table as the UserProvider for your application, you can check that here:


If so, you can indeed use the getuser() function that Paulo Cação mentioned.

You can do it in several ways, one for instance is to drag and drop an Expression to the screen where you want to show the user name and inside that Expression you just put it as this: GetUser(UserId).User.Name 

This UserId is a variable that you should fetch from your desired source, whether it is a TableRecords, an input parameter, etc.

Let us know if you managed to solve this.

Best Regards

2024-06-18 11-24-32
Siseko Thethi

Afternoon guys,

Got it Got it Got it...I'm so happy right now...thank you guys,thank you very much.

Regards!

2018-05-16 11-16-36
João Heleno
 
MVP

Hi Siseko

You have a simpler way to do that :)

You just need to reference User_GetName server action from the Users module.



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