Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Gallery Error waiting for Selected Office 365 User in ComboBox

(0) ShareShare
ReportReport
Posted on by 21

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:
  • dennyaaa Profile Picture
    dennyaaa 21 on at
    Re: Gallery Error waiting for Selected Office 365 User in ComboBox

    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.

  • PriyankaGeethik Profile Picture
    PriyankaGeethik 3,297 on at
    Re: Gallery Error waiting for Selected Office 365 User in ComboBox

    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
    dennyaaa 21 on at
    Re: Gallery Error waiting for Selected Office 365 User in ComboBox

    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
    PriyankaGeethik 3,297 on at
    Re: Gallery Error waiting for Selected Office 365 User in ComboBox

    Hi @dennyaaa ,

     

    How your are saving the data ? 

    The patch code for this dropdown.

  • dennyaaa Profile Picture
    dennyaaa 21 on at
    Re: Gallery Error waiting for Selected Office 365 User in ComboBox

    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
    PriyankaGeethik 3,297 on at
    Re: Gallery Error waiting for Selected Office 365 User in ComboBox

    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.

     

     

  • Verified answer
    dennyaaa Profile Picture
    dennyaaa 21 on at
    Re: Gallery Error waiting for Selected Office 365 User in ComboBox

    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 🙂

     

  • dennyaaa Profile Picture
    dennyaaa 21 on at
    Re: Gallery Error waiting for Selected Office 365 User in ComboBox

    Hello PG.

     

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

  • PriyankaGeethik Profile Picture
    PriyankaGeethik 3,297 on at
    Re: Gallery Error waiting for Selected Office 365 User in ComboBox

    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.

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,475

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,767

Leaderboard