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 / The method 'UserPhotoV...
Power Apps
Answered

The method 'UserPhotoV2' has an invalid value for parameter 'id

(0) ShareShare
ReportReport
Posted on by 13

Hi!

 

I have three dropdown sharepoint lists on the form. 
Dropdown lists are "Company", "Solution" and "User Roles". These lists have relation to eatch other.

In Solution-dropdown code is

Items = Filter(Solutions; Company.Id = DataCardValue8.Selected.Id)

Update = {Value: DataCardValue2.Selected.'{Name}'; Id: DataCardValue2.Selected.ID}

 

In addition, I have another list of solution admins. That is, when the user selects the solution, the application will list the admins of that selected solution.

 

The problem is that the app does not display the image. It gives me error "The method 'UserPhotoV2' has an invalid value for parameter 'id". 

Image = Office365Users.UserPhotoV2(ThisItem.Admin.Email)

 

I think the problem is in solution-dropdown list id, but I can't fix the problem.

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

    Hi @catwoman ,

     

    Could you please check the value of "ThisItem.Admin.Email"?

     

    Best Regards,

    Bof

  • PaulD1 Profile Picture
    2,914 on at

    Is there actually a photo for the user in question? The Office365Users connector is a bit rubbish and returns errors when querying for a User's Manager and none exists (e.g. either not set up or the user is the CEO) and I think the same is true for photos as well.

    IIRC the only way to trap these errors and handle them gracefully is by turning on the Experimental Setting 'Formula Level Error Management' but that may cause other formulas in your App to return different results (e.g. with the setting 'off' 1+null = 1, with the setting 'on' 1+null = null) so you have to be very careful when turning this on for an existing App should perform a complete re-test of all functions of the App to see if they are negatively affected.

  • JimmyW Profile Picture
    2,567 on at

    @catwoman As some already mention, do the user have an image.

    This one i have been using for and it works for everything, it supresses errors, for example if a user have left the company and the data is no longer available, if the user does not have an image it replaces it with a SampleImage.

     

    Example

    If(
    !IsBlank(ThisItem.'Requested By'.Email),
    If(
    IfError(Office365Users.UserPhotoMetadata(ThisItem.'Requested By'.Email).HasPhoto, ""),
    IfError(Office365Users.UserPhotoV2(ThisItem.'Requested By'.Email), ""),
    SampleImage
    ),
    SampleImage
    )



  • Verified answer
    catwoman Profile Picture
    13 on at

    Thank you all for your help!

     

    I got the problem solved.

    ThisItem.Admin.Email reseived the wrong value. 

    I changed this code: Items = Filter(Solutions; Company.Id = DataCardValue8.Selected.Id)

    to this: Filter(Solutions; Company.Id = DataCardValue8.Selected.ID)

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 232 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard