cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HarshD
Advocate I
Advocate I

Getting error when fetching user profile photo in powerapp from Office365 Connector

Office365Users.UserPhotoMetadata failed: {
"error": {
"code": "AuthenticationError",
"message": "Error authenticating with resource",
"innerError": {
"request-id": "9df3992e-af74-4931-941f-82f832bb6932",
"date": "2019-10-01T12:31:53"
}
}
}

 

But if I use this query I am able to get the photo User().Image.

 

Can anyone help?

 

In my environment, I don't have exchange online.

But the photo is present in delev as well as active directory.

 

3 REPLIES 3
v-xida-msft
Community Support
Community Support

Hi @HarshD ,

Could you please share a bit more about your issue?

 

Based on the error message that you mentioned, it seems to tell that there is something authentication error with the Office365Users connection in your app.

 

I have made a test on my side, and don't have the issue that you mentioned. Please check the following screenshot:6.JPG

Set the Text property of the Label to following:

Office365Users.UserPhotoMetadata(User().Email).HasPhoto       /* <-- Check if the user has defined a Photo on his profile */

If you want to retrieve user's photo data using Office365Users connector, please consider take a try with the following workaround:

Add a Image control, set the Image property to following:

Office365Users.UserPhotoV2(User().Email)

7.JPG

 

Please consider re-create a new connection to the Office 365 Users connector within your app, then try above formula again, check if the issue is solved.

 

Best regards,

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

Hi,

I am getting this error if I use this connector :  

error.PNG

 

But i am sure that connector is working, because i can fetch other data. I cant fetch profile image

 

error.PNG

 

Hi @HarshD ,

Currently, I could not reproduce your issue on my side. Please consider take a try with the following formula:

Office365Users.UserPhotoV2(Office365Users.MyProfileV2().userPrincipalName)

or

Office365Users.UserPhotoV2(Office365Users.MyProfileV2().id)

or

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

If the issue still exists, please consider submit an assisted support ticket through the following link:

https://powerapps.microsoft.com/en-us/support/pro

 

Best regards,

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

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (4,532)