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?
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.
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 ?
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.
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?
Hi @dennyaaa ,
You can one more setting if it helps in your case.
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.
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 🙂
Hello PG.
I've fiddled around with your code to no avail. The error is still present.
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.