cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AKB_2K
Helper II
Helper II

Updating office 365 profile photo using PowerApps

Hello All,

 

I am creating a PowerApp application for my team where I want to showcase training materials, along with team members information along with their pics. I have built in a feature on one of the screens where the person using the application can change their display pic which will then be updated across all applications in Office 365 domain i.e. Teams, Outlook, etc. To achieve this functionality, I am using the following function to showcase the user image under a image media Office365Users.UserPhoto(Office365Users.MyProfile().Id)

 

I have created a button called "Change Profile Pic". On clicking of this button, user is navigated to different page where they can upload a image stored on their system and click of save. SAVE button has following code mentioned in OnSelect -   Office365Users.UpdateMyPhoto("image/jpeg", UploadedImage1.Image); Back();

where UploadedImage1.Image is a image media which showcases the image uploaded by user from their machine. 

 

On clicking on save, everything works fine and I am navigated back to my start page BUT, the newly uploaded image doesnt showcase until and unless I refresh the app. Also the image doesnt get synced across various applications like I wanted to. Is this feature of changing "Profile Image" possible via PowerApps? If yes, what steps am I missing?

1 ACCEPTED SOLUTION

Accepted Solutions
v-monli-msft
Community Support
Community Support

Hi @AKB_2K ,

 

Try to workaround this by using a variable in the Image property of the image control:

 

V1

 

 

Then set the OnStart property of the app to:

 

Set(V1,Office365Users.UserPhoto(Office365Users.MyProfile().Id))

 

 

And set the OnSelect property that update the photo to:

 

Office365Users.UpdateMyPhoto("image/jpeg", UploadedImage1.Image); Set(V1,Office365Users.UserPhoto(Office365Users.MyProfile().Id));Back()

 

 

Regards,

Mona

Community Support Team _ Mona Li
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

3 REPLIES 3
v-monli-msft
Community Support
Community Support

Hi @AKB_2K ,

 

I can reproduce your issue. But I think this is just runtime issue and even if you update your profile photo from Office365 directly, it will take a refresh of the page to make the change updated.

T1.JPG

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-monli-msft
Community Support
Community Support

Hi @AKB_2K ,

 

Try to workaround this by using a variable in the Image property of the image control:

 

V1

 

 

Then set the OnStart property of the app to:

 

Set(V1,Office365Users.UserPhoto(Office365Users.MyProfile().Id))

 

 

And set the OnSelect property that update the photo to:

 

Office365Users.UpdateMyPhoto("image/jpeg", UploadedImage1.Image); Set(V1,Office365Users.UserPhoto(Office365Users.MyProfile().Id));Back()

 

 

Regards,

Mona

Community Support Team _ Mona Li
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

Nice, simple trick.

 

This definitely solves the refreshing app case but even now syncing of the profile image across O365 applications is a major problem. I can't see the profile image in Teams application which I uploaded via PowerApps yesterday.

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

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (74,019)