cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sajarac
Level 8

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
Community Support Team
Community Support Team

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

6 REPLIES 6
Community Support Team
Community Support Team

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

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?

patrickabel
Level: Powered On

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!

 

Anonymous
Not applicable

Re: Getting user name and picture

Nice, thanks for the suggestion! 🙂

I will try it out.

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 ?

RPNZ
Level: Powered On

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.

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,394)