cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
omi18
Post Partisan
Post Partisan

Office365 User Photo

Hello, 

 

I'm getting the below error message while trying to retrieve O365 user picture. 

Error: the method 'userphotov2' has an invalid value for parameter 'id'

 

I have this code for the Image: If(Office365Users.UserPhotoMetadata(Gallery5.Selected.email1).HasPhoto, Office365Users.UserPhotoV2(Gallery5.Selected.email1),RefIMG.Image)

 

Any suggestions?

 

Thanks,

Omi

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-albai-msft
Community Support
Community Support

Hi @omi18 ,

I used to answer a similar question to yours in another thread, and my solution did work for that man.

So I would suggest you try this formula:

If(
    !IsBlank(Gallery5.Selected.email1),
    If(
        Office365Users.UserPhotoMetadata(Gallery5.Selected.email1).HasPhoto=true,
        Office365Users.UserPhotoV2(Gallery5.Selected.email1),
        RefIMG.Image
    )
)

Best regards,

Allen

View solution in original post

3 REPLIES 3
RyanVH
Advocate II
Advocate II

I've had the same issue in the past. When restarting the app it magically worked sometimes..

 

I have an app that uses the exact same code like yours. The only difference is that i'm using Office365Users.UserPhoto() instead of UserPhotoV2

 

Kind regards

Ryan

omi18
Post Partisan
Post Partisan

Hi @RyanVH ,

 

Thanks, for the reply. 

 

Best,

Omi

v-albai-msft
Community Support
Community Support

Hi @omi18 ,

I used to answer a similar question to yours in another thread, and my solution did work for that man.

So I would suggest you try this formula:

If(
    !IsBlank(Gallery5.Selected.email1),
    If(
        Office365Users.UserPhotoMetadata(Gallery5.Selected.email1).HasPhoto=true,
        Office365Users.UserPhotoV2(Gallery5.Selected.email1),
        RefIMG.Image
    )
)

Best regards,

Allen

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.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

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 (3,167)