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

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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

@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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
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
Advocate I
Advocate 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
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,967)