Please... How can I get additional information from user profile ?
Question

Hello...


Please Can I to get aditional information of profile user  (as mobile number), after success login ? thanks...

(I desire obtain the mobile number, and other properties from profile user entity)

Y put the following code, but show me error....Is that a good idea or doest exist some one better ? 

(After login I called get_user server function (by send GetUserId()), then assign to User_Get.User.LocalUser.MobilePhone to my local variable...)

mvp_badge
MVP
Solution

Hello Carrara,

Hope you're doing well.


It seems that you're using User_Get action from UsersLocalManagement extension, which is causing you that error.

If you want to retrieve the information from User entity (Users module), you could simply use the entity action GetUser


However it is important to mention that this GetUser action returns an exception if the provided UserId is not found in the database.


To avoid this scenario, I suggest that you create a Server Action from your own that receives an UserId as input parameter and executes an Aggregate where you can fetch in the User entity by that Id. The output will be the record resulting from the query.

This way will allow you to avoid the exception (the output is empty if no record is found).


Hope that this helps you!


Kind regards,

Rui Barradas

THANKS....... it works perfect....

mvp_badge
MVP

You're most welcome :)

Please consider to mark above answer as a solution in order to close the thread.

Happy coding!


Kind regards,

Rui Barradas

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