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 / Help pls Office365User...
Power Apps
Unanswered

Help pls Office365Users.UserPhotoV2 failed error and nothing seem to work

(0) ShareShare
ReportReport
Posted on by 2

Hello everyone,
I just started learning Power Apps and I simultaneously work on an application
I trying to display all the users' peers in a gallery, I first started using the Get Onboard application code and played with it a bit and it worked but when I click on the play mode I get this error.

I tried different solutions found online and nothing seem to work I'm getting really desperate.

 

 

 

Set( MyProfile, Office365Users.MyProfile());

Set( MyUserId, MyProfile.Id);

ClearCollect(

MyPeersList,

ForAll(

Office365Users.DirectReports(Office365Users.Manager(MyUserId).Id),

{

DisplayName:DisplayName,

City:City,

JobTitle:JobTitle,

UserPrincipalName:UserPrincipalName,

GivenName:GivenName,

Mail:Mail,

Id:Id,

Mobile:mobilePhone,

OfficePhone:TelephoneNumber,

Department:Department,

OfficeLocation:OfficeLocation,

Photo:If(

// check if the the user has an email and a profile picture

!IsBlank(Mail) And Office365Users.UserPhotoMetadata(Mail).HasPhoto,

// get the profile picture

Office365Users.UserPhotoV2(Mail),

profile )

}

);

);

 

 

 

Thank you so much for your time

 

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,854 Super User 2026 Season 2 on at

    Hi @Papicha00 ,

     

    Profile is not recognized in the If statement, so I replaced it with "SampleImage":

     

    Set( MyProfile, Office365Users.MyProfile());
    
    Set( MyUserId, MyProfile.Id);
    
    ClearCollect(
    
    MyPeersList,
    
    ForAll(
    
    Office365Users.DirectReports(Office365Users.Manager(MyUserId).Id),
    
    {
    
    DisplayName:DisplayName,
    
    City:City,
    
    JobTitle:JobTitle,
    
    UserPrincipalName:UserPrincipalName,
    
    GivenName:GivenName,
    
    Mail:Mail,
    
    Id:Id,
    
    Mobile:mobilePhone,
    
    OfficePhone:TelephoneNumber,
    
    Department:Department,
    
    OfficeLocation:OfficeLocation,
    
    Photo:If(
    
    // check if the the user has an email and a profile picture
    
    !IsBlank(Mail) And Office365Users.UserPhotoMetadata(Mail).HasPhoto,
    
    // get the profile picture
    
    Office365Users.UserPhotoV2(Mail),
    
    SampleImage )
    
    }
    
    );
    
    );
  • Papicha00 Profile Picture
    2 on at

    Hello thank you so much for your comment, I've tried it and it's still not working

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
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard