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 III
Super User III

@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

View solution in original post

7 REPLIES 7
RandyHayes
Super User III
Super User III

@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

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 III
Super User III

@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

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 III
Super User III

@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
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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

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