cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Kudo Kingpin
Kudo Kingpin

Getting user name and picture

Hi there, just a quick question?

 

is there any way to get the user name, just the name and the picture form the office 365?

 

user().Fullname is what I am using and user.image. but I am getting name and last name and pictre and empty box, because I am guessing is getting from the PA account not he office 365

 

please advise. 

 

regards

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Getting user name and picture

Hi @sajarac,

 

If user() fucntion can't meet your requirements, then you may take a look at the Office 365 Users Connection:

Office 365 Users Connection in PowerApps

To get your user photo, please take a try with the method below:

Office365Users.UserPhoto(Office365Users.MyProfile().Id)

36.PNG

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
Highlighted
Community Support
Community Support

Re: Getting user name and picture

Hi @sajarac,

 

If user() fucntion can't meet your requirements, then you may take a look at the Office 365 Users Connection:

Office 365 Users Connection in PowerApps

To get your user photo, please take a try with the method below:

Office365Users.UserPhoto(Office365Users.MyProfile().Id)

36.PNG

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Anonymous
Not applicable

Re: Getting user name and picture

Hi ,

 

Is there a way to bring in other O365 users' photos?

 

I am using the OrgBrowser template app and would like to add the user images. However at this stage it appears as if only the picture of 'oneself' (the accessing user) can be displayed, is this correct?

Highlighted
Advocate II
Advocate II

Re: Getting user name and picture

@Anonymous yes there is! Try the following:

Office365Users.UserPhoto(ThisItem.UserPrincipalName)

In the above example, I've got a Gallery where the items are bound to a Office365Users data-source and am then using the UserPrincipalName off of the current item to lookup the user's profile photo. Works like a charm!

 

Highlighted
Anonymous
Not applicable

Re: Getting user name and picture

Nice, thanks for the suggestion! 🙂

I will try it out.

Highlighted
Anonymous
Not applicable

Re: Getting user name and picture

Hi patrickabel 

 

I have now tried this, however could not connect the gallery to the O365Users as a datasource. Can you please tell me what you entered as being the gallery's items ?

Highlighted
Helper I
Helper I

Re: Getting user name and picture

I'm using the Org Browser app which does a search and returns a variable called First(Employee)

 

I can add the employees image buy inserting an image into a card and using data string:

 

Office365Users.UserPhoto(First(Employee).UserPrincipalName)

 

Hope this helps.

Highlighted
Regular Visitor

Re: Getting user name and picture

Hello,

 

In my case worked this:

 

UsuariosdeOffice365.UserPhotoV2(User().Email)

 

Regards.

Helpful resources

Announcements
Check this Out

Announcing

Class of 2020- Season 2

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,634)