cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
omi18
Post Patron
Post Patron

Office 365 profile Pic

Hello,

 

I'm trying to get a picture from O365 profile. 

 

Case: I have a gallery connected to the SQL server. And I'm trying to show a picture of the same person using O365 profile. 

 

is there any way or suggestion? 

 

Best,

Omi

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@omi18 

What is the error you are seeing?  Is the value in ThisItem.email1 a valid email?  If there are ANY invalid email addresses in your Gallery, you will get an error on the formula.  Usually though, any row that IS valid, will have a photo.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

7 REPLIES 7
RandyHayes
Super User
Super User

@omi18 

You will need to utilize the Office 365 Users connector and the GetUserPhotoV2 action to get this.

Supply the user email address in the parameter and, if all is valid, you will get the image.  You can apply this to the Image property of an Image control.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hi @RandyHayes ,

 

I have the below formula for image property. 

 

Hello,

 

I'm trying to get a picture from O365 profile. 

 

Office365Users.UserPhotoV2(ThisItem.email1)

 

but gives me an error. 

 

Best,

Omi

RandyHayes
Super User
Super User

@omi18 

What is the error you are seeing?  Is the value in ThisItem.email1 a valid email?  If there are ANY invalid email addresses in your Gallery, you will get an error on the formula.  Usually though, any row that IS valid, will have a photo.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

@RandyHayes ,

 

Yes, the email is the same as user's O365 profile. 

 

omi18_0-1613490140654.png

Thanks,

Omi

RandyHayes
Super User
Super User

@omi18 

If the emails are valid, you will get photos.

Try to hardcode an email address into the formula:

Office365Users.UserPhotoV2("youremailaddress")

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
danielvi
Helper I
Helper I

Hi,

I have used other method that works for me.

 

I use the formula:  "https://outlook.office.com/owa/service.svc/s/GetPersonaPhoto?email=" & ThisItem.Email & "&size=HR96x96"

 

Try it and see if works for you as well.

Best!

Daniel

Hi @RandyHayes ,

 

It worked. I had to restart the Powerapps studio. 

 

Thanks,

Omi

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,756)