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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Gallery with Userprofi...
Power Apps
Unanswered

Gallery with UserprofileV2 has an invalid value for parameter userid error

(0) ShareShare
ReportReport
Posted on by 143

Building a dynamic org chart and have 2 Galleries

1st Gallery for current user name and info

2nd Gallery is Direct Reports of user in Gallery 1

 

OnStart is Set(varCurrentUser, User().Email)

The Items property of Gallery 1 is set to: Office365Users.UserProfileV2(varCurrentUser)

Items of Gallery 2 is set to: Office365Users.DirectReportsV2(varCurrentUser).value

 

I get these error below when viewing the App on Browser

Office365Users.UserProfileV2 failed: The method 'UserProfileV2' has an invalid value for parameter 'id'
Office365Users.DirectReportsV2 failed: The method 'DirectReportsV2' has an invalid value for parameter 'id'

 

I was getting same error for userphto but i fixed that using

If(!IsBlank(ThisItem.id),

Office365Users.UserPhotoV2(varCurrentUser), SampleImage)

Tried same solution for Userprofile & DirectReports but no good

How. can I fix this?

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,061 Most Valuable Professional on at

    Hi @johnnykalsi ,

    The first one will return a single record and you can display the user in Labels (DisplayName, Department etc)

    Office365Users.UserProfileV2(varCurrentUser)

    This will return all Direct Reports in a Gallery

    Office365Users.DirectReportsV2(varCurrentUser)

    and the same as above. If you want the User's Photo, use this in an Image Control in the Gallery - the first

    Office365Users.UserPhotoV2(ThisItem.id)

    and the second

    Office365Users.UserPhotoV2(ThisItem.Id)

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • johnnykalsi Profile Picture
    143 on at

    You posted the same thing as i posted. What is different?

  • WarrenBelz Profile Picture
    153,061 Most Valuable Professional on at

    @johnnykalsi ,

    Your Gallery2 posted was Office365Users.DirectReportsV2(varCurrentUser).value

    I tested what I posted and it produces the expected results.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Amir7 Profile Picture
    2 on at

    IfError( Office365Users.UserProfileV2(varcurrentuser), [], Office365Users.UserProfileV2(varcurrentuser) )


    Try this, might 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard