web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Display current user p...
Power Apps
Answered

Display current user profile picture (On all devices)

(0) ShareShare
ReportReport
Posted on by 2,567

Hi

 

I want to display the current logged in users profile image and i want it to work on mobile devices to.

Now if i use the following lines it works but multiple times i can see an error showing, the image is still displayed correctly, sometimes the error message is now showed at all and i don't know why i receive the error at all.

 

If(Microsoft365Users.UserPhotoMetadata(Microsoft365Users.MyProfileV2().mail).HasPhoto=false,SampleImage,Microsoft365Users.UserPhotoV2(Microsoft365Users.MyProfileV2().mail))

 

Error Message displayed at random (Image is always showed correctly even if the error message is displayed)

2020-09-02 18_53_59-Window.png

 

If i use User().Image it works on some devices but not all and not for all users.

Any suggestion how i can work around this? Or let me know whats wrong with my lines.

Categories:
  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @JimmyWork :

    I've made a test but did not encounted the problem you mentioned.

    Let us work together step by step to find the problem:

    Firstly,I'm not sure if you quoted the name of the connector correctly.Could you show me a screenshot of your data source?

    1.JPG

    Secondly,I am not sure if this is caused by Throttling Limits.

    The call limit for Office 365 Users connector is 1000 in 60s.Although this is unlikely, you can try this code to reduce the number of calls.

     

    If(
     Office365Users.UserPhotoMetadata(User().Email).HasPhoto,
     Office365Users.UserPhotoV2(User().Email),
     SampleImage
    )

     

    On your side,it should be

     

    If(
     Microsoft365Users.UserPhotoMetadata(User().Email).HasPhoto,
     Microsoft365Users.UserPhotoV2(User().Email),
     SampleImage
    )

     

    Finally,I think a safer way is to use the above code to get the user's picture and save it in a variable when loading the app. This prevents the app from calling office365User connection repeatedly.

    1\Set the App's OnStart property to:

     

    Set(
     UserPhoto, /*UserPhoto is my custom variable*/
     If(
     Office365Users.UserPhotoMetadata(User().Email).HasPhoto,
     Office365Users.UserPhotoV2(User().Email),
     SampleImage
     )
    )

     

    2\Set the image control's Image property to:

     

    UserPhoto

     

    Best Regards,

    Bof

  • JimmyW Profile Picture
    2,567 on at

    @v-bofeng-msft Thank you, this seems to work not producing the error message. Really appreciate the help 🙂

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard