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 Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (6,594)