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 / Gallery Error waiting ...
Power Apps
Answered

Gallery Error waiting for Selected Office 365 User in ComboBox

(0) ShareShare
ReportReport
Posted on by 51

Hello everyone.

 

I've recently build a little updated version of an old people picker, but I am having some trouble.

 

I have a Combo Box with the following code in 

Items: Office365Users.SearchUserV2({top:999}).value

 

When picking an Employee, I want the employees 365 picture showed in a gallery box, which I have done with the following code:

Office365Users.UserPhotoV2(ComboBox1.Selected.UserPrincipalName)

 

The Error occurs when initializing the app, as there is no selected value for the gallery to show, and therefore throws the following:

Office365Users.UserPhotoV2 failed: The method 'UserPhotoV2' has en invalid value for parameter 'id'

 

How do I get the gallery to not show an Error when no user has been selected?

Categories:
I have the same question (0)
  • PriyankaGeethik Profile Picture
    3,320 Super User 2024 Season 1 on at

    Hi @dennyaaa ,

     

    Please try the below code. If it helps.

     

    If(!IsBlank(ComboBox1.SearchText),Office365Users.SearchUserV2({top:999}).value)

     

    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.

  • dennyaaa Profile Picture
    51 on at

    Hello PG.

     

    I've fiddled around with your code to no avail. The error is still present.

  • Verified answer
    dennyaaa Profile Picture
    51 on at

    After some more fiddling around, I tried to isolate the issue to Image item:

     

    If(!IsBlank(ComboBox1.SearchText),Office365Users.UserPhotoV2(ComboBox1.Selected.UserPrincipalName))

    It seems to be working now.

     

    Thanks for the quick responses 🙂

     

  • PriyankaGeethik Profile Picture
    3,320 Super User 2024 Season 1 on at

    Hi @dennyaaa ,

     

    You can one more setting if it helps in your case. 

    PG_WorXz10_0-1630330300577.png

     

    File - > Setting  -> Upcoming Features -> Formula Level  error management click on

     

     

    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.

     

     

  • dennyaaa Profile Picture
    51 on at

    So after testing it through the Power apps builder, no errors were found.

     

    I then saved it and published it. Sharepoint is not happy when entering a name in the combobox it still gives the error:

    Office365Users.UserPhotoV2 failed: The method 'UserPhotoV2' has en invalid value for parameter 'id'

     

    Why does it not give the error in the Power Apps Studio but only in SharePoint?

     

  • PriyankaGeethik Profile Picture
    3,320 Super User 2024 Season 1 on at

    Hi @dennyaaa ,

     

    How your are saving the data ? 

    The patch code for this dropdown.

  • dennyaaa Profile Picture
    51 on at

    I am not saving the data. I am simply searching in a ComboBox, selecting 1 user and want to have the profile picture displayed in a Gallery.

     

    I still have no clue why it does not give any errors in the power apps studio, but as soon as the app is published in Sharepoint, the error pops right back up.

  • PriyankaGeethik Profile Picture
    3,320 Super User 2024 Season 1 on at

    Hi @dennyaaa ,

     

    In that case please try to change the error message setting in your app as I mentioned in my previous message. 

    Give it a try and let me know if it works or not ? 

  • dennyaaa Profile Picture
    51 on at

    Hello again PG.

     

    I've been swarmed with work and did not see your reply before now.

     

    I tried your suggested solution, but it did not do anything (still getting the error when the application is published)

     

    I found some old code which worked (only works with SearchUser, not V2), but I am working towards making the newer more streamlined code to work with the current version.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 514

#2
WarrenBelz Profile Picture

WarrenBelz 419 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 295

Last 30 days Overall leaderboard